What are examples of unsafe code in Ruby?

I'm looking at using Sidekiq , an asynchronous job processing queue written in Ruby that runs its jobs using threads.

Because of the MRI and the GIL, developers tend to stay away from writing multithreaded code in Ruby, and therefore there isn't much writing about thread-safe code in Ruby.

Some common day-to-day patterns, such as result ||= something.call

no surrounding mutex, are not thread safe. So my question is some other simple plain Ruby code that is not thread-safe?

+3
multithreading ruby ruby-on-rails


source to share


No one has answered this question yet

Check out similar questions:

1487
What is the difference between a process and a thread?
978
What is attr_accessor in Ruby?
761
What is daemon thread in Java?
674
What is thread safe or unsafe thread in PHP?
646
How do I unit test threaded code?
325
What is meant by "thread safe" code?
81
how to know what is NOT thread safe in ruby?
4
Is ruby ​​2.1.2 timeout not yet thread safe?
2
As a result of the test Ruby calculates the total CPU time in the thread
0
Thread counter within method



All Articles
Loading...
X
Show
Funny
Dev
Pics