You can use simulated threads with JavaPoly, which allows you to utilize the full Java threading model (including locks).  If you enable the native jvm, you get true threads.
The reason you wouldn&#x27;t want to use WebWorkers as a primitive for building threads is that the javascript memory model doesn&#x27;t allow for shared memory, so you would take a huge performance hit while crossing the serialization boundary for virtually every memory access.  You&#x27;d be better off just using the simulated threads at that point.