4 ms·
The big question is whether this mimics the "non-blocking" behavior of goroutines - if you block in a goroutine with a select on a channel in Go (or rather, if
by ceptorial 12y ago
The big question is whether this mimics the "non-blocking" behavior of goroutines - if you block in a goroutine with a select on a channel in Go (or rather, if you do ANY synchronous operation, including network calls, channel operations, etc.), Go will automatically context switch off the goroutine and run another one. But if you have a tasklet that selects on a channel, will Goless/Stackless automatically run a different tasklet, or will that tasklet stall a thread (or worse, the GIL)? What if the tasklet is doing a synchronous HTTP call or waiting on a future to complete?
- rgalanakis 12y agoHi ceptorial, I have toyed around with this a lot. Ultimately goless is just a wrapper over stackless a gevent, which bother offer monkeypatches for the stdlib. So if you want this behavior, you can just monkeypatch first, and everything should work. I decided not to wrap the monkeypatching (for now) because I did not want to get bugs about how it doesn't work :) However I should make note of this in the docs. You should make an issue or PR!