Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign ups/greenlets/threads/g #641
Comments
|
Do you remember how well threads worked compared to greenlets? |
|
I think it was about twice the latency, but I should measure.
|
|
If someone wants to look at this, the process be doing about the opposite of commit 2e54cbb to move us back to threads, then playing around to see how it feels. |
|
I started #681 to work on this. I need some dedicated time with a whiteboard to really dive in and understand the threading model, but this looks promising so far. |
|
(I've obviously made no progress on this, other implementations welcome!) |
|
I think using threads the same way greenlets are currently used would not fix the issue: user sets up a "threadlocal" in their shell or embedding environment, submits a statement to bpython, bpython decides to perform the evaluation in an other thread / greenlet (I'm guessing? or the failure makes no sense). If the statement accessed the threadlocal, the evaluation might blow up because it's not been setup in the other threads / greenlets of bpython's pool (or maybe it never works at all if bpython spawns a new greenlet for each evaluation). |
The only reason to use greenlets instead of threads was less latency. We should measure how much less, because it's breaking things for people (#640) and is another dependency to install. Here's the commit: 2e54cbb
This could be a large change and shouldn't go in a bugfix release.