mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
doc: remove the paragraph about vfmt renaming go
to spawn
(already finished) (#23673)
This commit is contained in:
parent
7720b5f49a
commit
8bbaab396f
1 changed files with 5 additions and 6 deletions
11
doc/docs.md
11
doc/docs.md
|
@ -4365,8 +4365,11 @@ println(compare(1.1, 1.2)) // -1
|
||||||
|
|
||||||
### Spawning Concurrent Tasks
|
### Spawning Concurrent Tasks
|
||||||
|
|
||||||
V's model of concurrency is going to be very similar to Go's.
|
V's model of concurrency is similar to Go's.
|
||||||
For now, `spawn foo()` runs `foo()` concurrently in a different thread:
|
|
||||||
|
`go foo()` runs `foo()` concurrently in a lightweight thread managed by the V runtime.
|
||||||
|
|
||||||
|
`spawn foo()` runs `foo()` concurrently in a different thread:
|
||||||
|
|
||||||
```v
|
```v
|
||||||
import math
|
import math
|
||||||
|
@ -4394,10 +4397,6 @@ fn main() {
|
||||||
> including resource overhead and scalability issues,
|
> including resource overhead and scalability issues,
|
||||||
> and might affect performance in cases of high thread count.
|
> and might affect performance in cases of high thread count.
|
||||||
|
|
||||||
There's also a `go` keyword. Right now `go foo()` will be automatically renamed via vfmt
|
|
||||||
to `spawn foo()`, and there will be a way to launch a coroutine with `go` (a lightweight
|
|
||||||
thread managed by the runtime).
|
|
||||||
|
|
||||||
Sometimes it is necessary to wait until a parallel thread has finished. This can
|
Sometimes it is necessary to wait until a parallel thread has finished. This can
|
||||||
be done by assigning a *handle* to the started thread and calling the `wait()` method
|
be done by assigning a *handle* to the started thread and calling the `wait()` method
|
||||||
to this handle later:
|
to this handle later:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue