Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

s/greenlets/threads/g #641

Open
thomasballinger opened this issue Oct 10, 2016 · 6 comments
Open

s/greenlets/threads/g #641

thomasballinger opened this issue Oct 10, 2016 · 6 comments
Labels

Comments

@thomasballinger
Copy link
Member

@thomasballinger thomasballinger commented Oct 10, 2016

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.

@sebastinas
Copy link
Contributor

@sebastinas sebastinas commented Oct 11, 2016

Do you remember how well threads worked compared to greenlets?

@thomasballinger
Copy link
Member Author

@thomasballinger thomasballinger commented Oct 11, 2016

I think it was about twice the latency, but I should measure.
On Tue, Oct 11, 2016 at 5:09 PM Sebastian Ramacher notifications@github.com
wrote:

Do you remember how well threads worked compared to greenlets?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#641 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAcAf-rl7WOyiz8X029nYdTQg3C7qPGwks5qy_slgaJpZM4KSxIH
.

@thomasballinger
Copy link
Member Author

@thomasballinger thomasballinger commented Dec 13, 2016

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.

@thomasballinger
Copy link
Member Author

@thomasballinger thomasballinger commented Apr 22, 2017

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.

@thomasballinger
Copy link
Member Author

@thomasballinger thomasballinger commented Jun 8, 2018

(I've obviously made no progress on this, other implementations welcome!)

@xmo-odoo
Copy link

@xmo-odoo xmo-odoo commented Aug 8, 2019

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.