News for hackers. Stuff that matters.
Re:Ruby core classes aren't thread safe by jstorimer on Monday February 25, 2013 @04:14PM (#5281839)
AFAIK there is no spec. MRI is the reference implementation, but many things are experimental or intentionally unspecified.

Given that MRI ships with a GIL, the only core classes that are intentionally aware of multi-threading concerns are Mutex, ConditionVariable, and Queue.

Re:Ruby core classes aren't thread safe by aardvark179 on Monday February 25, 2013 @04:25PM (#5281915)
A GIL does not mean classes should ignore concurrency concerns, it's still possible to get odd behaviour from things like hash table implementations in a GIL based interpreter when inserting objects as you may end up thread switching mid operation.

What saves you most of the time is that it isn't worth switching threads too often so normally you get lucky.

Re:Ruby core classes aren't thread safe by masklinn on Monday February 25, 2013 @04:19PM (#5281877)
Even a thread-aware collection where collection methods are synchronized on an internal lock (as in Java 1.0 — this was quickly dropped as it's effectively useless) wouldn't help here: having `[]` and `[]=` safe will not make calling `[]`, performing an addition and then calling `[]=` safe.
Re:Ruby core classes aren't thread safe by steveklabnik on Monday February 25, 2013 @05:32PM (#5282322)
There is an ISO spec, but it's not really relevant to the future of the language.