> If you use a two-word representation, you can't atomically set a value
On 32-bit architectures. 64-bits architectures have atomic XCHG and CMPXCHG operations.
That being said, the plan for Jaegermonkey is to upgrade jsvals from 64 to 128 bits so that's not the final solution. However...
> Is their JS engine inherently single-threaded only?
Yes, for certain values of 'yes'. Each script runs in its own context. There can be many scripts and many contexts but each context is only executed by a single thread.
On 32-bit architectures. 64-bits architectures have atomic XCHG and CMPXCHG operations.
That being said, the plan for Jaegermonkey is to upgrade jsvals from 64 to 128 bits so that's not the final solution. However...
> Is their JS engine inherently single-threaded only?
Yes, for certain values of 'yes'. Each script runs in its own context. There can be many scripts and many contexts but each context is only executed by a single thread.