Skip to content

Why does CSP use a synchronous execution model? #203

Answered by AdamGlustein
MrMonad asked this question in Q&A
Discussion options

You must be logged in to vote

Parallel or distributed csp still remains a topic of discussion and an area for future growth.

The primary reason that the engine runs on a single-thread is GIL constraints. Since users can write pure Python nodes which will invoke the GIL, multithreading node execution gets hairy. Rank-level parallelization (what you are suggesting, passing nodes off into a thread pool) will only work to our advantage if all node are using a C++ implementation.

A secondary reason is that even with the C++ nodes, many are very quick computations, so the overhead of maintaining the thread pool/synchronization is more than the node itself. For example, baselib nodes like sample, merge etc. are all extremely…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@MrMonad
Comment options

@AdamGlustein
Comment options

Answer selected by MrMonad
Comment options

You must be logged in to vote
2 replies
@MrMonad
Comment options

@AdamGlustein
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants