|
|
|
|
|
by monocasa
1527 days ago
|
|
Yes, sort of. They can all call into JS, but that JS context is single threaded and serializes access. There can be races depending on what assumptions you make, but those races can't cause memory unsafety of the type usages of Sync and Send are trying to prevent. |
|
I assume if it’s even possible, it might execute the code only if the main thread is not executing any events - which happens only once per eventloop iteration.
I guess what is happening is that worker can call into JS, but can not access the DOM or anything else living on the main thread. They have to send messages to the other thread, just as JavaScript workers would need to do.