Why does Zipline(QuickJS) need a single threaded q...
# squarelibraries
a
Why does Zipline(QuickJS) need a single threaded queue? Even a Dispatcher with limited parallelsim fails 😕.
j
Our native JS engine, QuickJS, is not concurrent
a
But wouldn't limited parallelism (set to 1) ensure that it is accessed by one thread at a time?
g
one thread at a time != always the same thread
a
but it would still ensure that ensure that it is not accessed concurrently. Is the restriction to access the instance from the same thread always or no concurrency?
j
That could work. There’s potentially memory-model challenge where we need to flush cache lines between thread hops
(I don’t know how much of a problem this is in practice)
a
Tried with limited parellism set to one but it causes a stack overflow error on android and on iOS it crashes with a bad access exception.
j
I think that might be a different issue. I’ve had problems with JS stack sizes and I’ve mitigated by configuring larger stack sizes on the non-main thread. But I think we aught to make this much easier.
In particular we should move some of this to zipline from Redwood