mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
fmt: replace go
with spawn
This commit is contained in:
@ -24,14 +24,14 @@ fn main() {
|
||||
}
|
||||
|
||||
for id in 0 .. args.workers {
|
||||
workers << go sim.sim_worker(id, app.request_chan, [app.result_chan])
|
||||
workers << spawn sim.sim_worker(id, app.request_chan, [app.result_chan])
|
||||
}
|
||||
|
||||
handle_request := fn [app] (request &sim.SimRequest) ! {
|
||||
app.request_chan <- request
|
||||
}
|
||||
|
||||
go app.gg.run()
|
||||
spawn app.gg.run()
|
||||
|
||||
sim.run(args.params, grid: args.grid, on_request: sim.SimRequestHandler(handle_request))
|
||||
}
|
||||
|
@ -38,16 +38,16 @@ fn main() {
|
||||
|
||||
// start a worker on each core
|
||||
for id in 0 .. app.args.workers {
|
||||
workers << go sim.sim_worker(id, app.request_chan, [app.result_chan, img_result_chan])
|
||||
workers << spawn sim.sim_worker(id, app.request_chan, [app.result_chan, img_result_chan])
|
||||
}
|
||||
|
||||
handle_request := fn [app] (request &sim.SimRequest) ! {
|
||||
app.request_chan <- request
|
||||
}
|
||||
|
||||
workers << go img.image_worker(mut writer, img_result_chan, img_settings)
|
||||
workers << spawn img.image_worker(mut writer, img_result_chan, img_settings)
|
||||
|
||||
go app.gg.run()
|
||||
spawn app.gg.run()
|
||||
|
||||
sim.run(app.args.params,
|
||||
grid: app.args.grid
|
||||
|
@ -48,7 +48,7 @@ pub fn new_app(args simargs.ParallelArgs) &App {
|
||||
fn init(mut app App) {
|
||||
app.iidx = app.gg.new_streaming_image(app.args.grid.width, app.args.grid.height, 4,
|
||||
pixel_format: .rgba8)
|
||||
go pixels_worker(mut app)
|
||||
spawn pixels_worker(mut app)
|
||||
}
|
||||
|
||||
fn frame(mut app App) {
|
||||
|
@ -35,7 +35,7 @@ fn main() {
|
||||
}
|
||||
|
||||
for id in 0 .. args.workers {
|
||||
workers << go sim.sim_worker(id, request_chan, [result_chan])
|
||||
workers << spawn sim.sim_worker(id, request_chan, [result_chan])
|
||||
}
|
||||
|
||||
mut x := 0
|
||||
|
@ -34,10 +34,10 @@ fn main() {
|
||||
}
|
||||
|
||||
for id in 0 .. args.workers {
|
||||
workers << go sim.sim_worker(id, request_chan, [result_chan])
|
||||
workers << spawn sim.sim_worker(id, request_chan, [result_chan])
|
||||
}
|
||||
|
||||
workers << go img.image_worker(mut writer, result_chan, img_settings)
|
||||
workers << spawn img.image_worker(mut writer, result_chan, img_settings)
|
||||
|
||||
handle_request := fn [request_chan] (request &sim.SimRequest) ! {
|
||||
request_chan <- request
|
||||
|
Reference in New Issue
Block a user