File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4365,8 +4365,11 @@ println(compare(1.1, 1.2)) // -1
43654365
43664366### Spawning Concurrent Tasks
43674367
4368- V's model of concurrency is going to be very similar to Go's.
4369- For now, ` spawn foo() ` runs ` foo() ` concurrently in a different thread:
4368+ V's model of concurrency is similar to Go's.
4369+
4370+ ` go foo() ` runs ` foo() ` concurrently in a lightweight thread managed by the V runtime.
4371+
4372+ ` spawn foo() ` runs ` foo() ` concurrently in a different thread:
43704373
43714374``` v
43724375import math
@@ -4394,10 +4397,6 @@ fn main() {
43944397> including resource overhead and scalability issues,
43954398> and might affect performance in cases of high thread count.
43964399
4397- There's also a ` go ` keyword. Right now ` go foo() ` will be automatically renamed via vfmt
4398- to ` spawn foo() ` , and there will be a way to launch a coroutine with ` go ` (a lightweight
4399- thread managed by the runtime).
4400-
44014400Sometimes it is necessary to wait until a parallel thread has finished. This can
44024401be done by assigning a * handle* to the started thread and calling the ` wait() ` method
44034402to this handle later:
You can’t perform that action at this time.
0 commit comments