Replies: 2 comments 2 replies
-
Yes you're correct. Each kernel runs in its own thread, but they all run in the same process (and in the same process as the server). Although won't Python release the GIL between instructions at its own discretion? Do you want each session ("kernel") to run in its own process (that's what we do in edit mode)? For app mode that overhead felt overkill (and led to memory pressure). But we could potentially make it a flag. |
Beta Was this translation helpful? Give feedback.
-
Yes, they will get some time. Each kernel in marimo has a few threads running concurrently with the main thread:
But yes a very tight (Python) loop would probably degrade performance.
Makes sense
Would you be open to making a docs PR for this? Thanks for the discussion by the way! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Am I correct in thinking that the FastAPI Programmatic Backend runs the Marimo kernel in the same process as the FastAPI service? If that's the case, it seems likely a long-running non-async operation could block the server from servicing other requests due to the GIL?
E.g. something like this:
If this is the case, are there any mitigations or workarounds? Is moving computation into another process on the table as a possible improvement?
Beta Was this translation helpful? Give feedback.
All reactions