Writer at 2 Minute Streaming & my socials (X, LinkedIn)
Apache Kafka Committer
previously a Staff Software Engineer at Confluent. Lots of growth. Left to pursue other things after 6 years.
Great, thanks!
One note: without Thread.new around the first loop this code could not ever run both loops in parallel, even if MRI had no GIL. Maybe a typo.
Of course, the main thread is a... thread, but how that matters for the issue?
Any line of code that runs synchronously forces the next line to wait. So, we need a Thread.new, just to let the interpreter to reach the next line while the first one is running.
We're a place where coders share, stay up-to-date and grow their careers.
Top comments (7)
Is it just me or has this post disappeared? Here’s a screenshot:
thepracticaldev.s3.amazonaws.com/i...
Here too. Maybe the discussion thread locked the main body thread ;)
I've no idea where this went. Let me reach out to support
Thank you, really nice article.
Great, thanks!
One note: without Thread.new around the first loop this code could not ever run both loops in parallel, even if MRI had no GIL. Maybe a typo.
I think it's not a type, the
main threadis also a threadOf course, the main thread is a... thread, but how that matters for the issue?
Any line of code that runs synchronously forces the next line to wait. So, we need a Thread.new, just to let the interpreter to reach the next line while the first one is running.