Replies: 2 comments
-
I found a temporary solution for my issue: I import and execute the blocking code with a |
Beta Was this translation helpful? Give feedback.
-
Minimal reproduction code:
Second simple script:
Have the server send with these headers for SharedArrayBuffer support:
Start the first script then start the second in another window/tab. |
Beta Was this translation helpful? Give feedback.
-
Hi!
I have a Brython program starting a webworker. The webworker is written in a "synchronous" style and would sometimes block itself on a SharedArrayBuffer. For example, calling sleep using the following code:
I notice that when I open 2 tabs of the same program (using Brython built from the latest git commit), Brython will block the Python code execution of the second tab opened until I close the first tab (or when the sleep ends). I tried to debug but it's not really trivial to debug webworkers. For now my guess is that it's related to Brython's indexedDB operations performed in tasks or mictotasks. IndexedDB will block open calls with higher version number as long as someone else is keeping an open context on an older version. I guess that my sleep call froze that operation on the first tab before it could be closed properly and that's why the second one was blocked.
I have two questions regarding this behaviour:
Thanks,
Shlomi
Beta Was this translation helpful? Give feedback.
All reactions