Re:JEP proposed to target JDK 19: 425: Virtual Threads (Prev...
by SemanticStrengh on Monday May 02, 2022 @03:31PM
(#31239728)
Oh thank u web locks are a thing then.
Well in all seriousness there are many valid uses for web workers, e.g. For offline processing of localstorage
But if you don't, then yeah, you sort of run right into the need for an actual lock since you can have shared memory in concurrently executing interpreters. Entire: Web Lock [1] Specifically designed to resolve this issue.
In typical JS programming this is not an issue, but if you are trying to really abuse that javascript VM then this is the way you'd do it.
[1] https://developer.mozilla.org/en-US/docs/Web/API/Web_Locks_A...