3 ms·
This is not the same thing as Go. Traditional languages tend to produce unreadable, message and difficult to follow code when describing concurrent tasks -- thi
by jessedhillon 15y ago
This is not the same thing as Go. Traditional languages tend to produce unreadable, message and difficult to follow code when describing concurrent tasks -- this is the impetus for a language like Go, where concurrency is built-in.
Also, I believe all Javascript engines are single-threaded -- try passing to `go()` a function which doesn't return and you will see that nothing outside of that loop will ever be executed.
- tantalor 15y ago> you will see that nothing outside of that loop will ever be executed Yes, that is true. Maybe I wasn't clear, but I tried to point out that every "thread of control" must yield as soon as possible to the event loop in JavaScript. Since Go is not single-threaded, a real goroutine doesn't need to yield.