Glenn Parker wrote:
> Yukihiro Matsumoto wrote:
> > "Charles Mills" <cmills / freeshell.org> writes:
> >
> > |Is / will this be the case when using pthreads?
> > |in Ruby 2.0?
> >
> > No.
>
> Matz, could you please elaborate just a little bit?  I *think* what
you
> are saying is that operations like Array#delete will *not* be atomic
> under pthreads, but it's hard to tell.  So, I will try asking again.

I imagine making operations atomic under pthreads is difficult to
implement (and slow) since Ruby cannot control the context switching
(or at least to the degree it can now using its own thread
implementation), so everything would have to use its own locking
scheme.

>
> What sorts of operations, if any, will be implicitly atomic under
pthreads?

Good question.  I assume IO would by one, since when you compile with
pthreads most C stdlibs make stdio functions thread safe, but then I
think ruby 2.0 will not be using stdio.  (Maybe this is partly to
ensure IO functions are thread safe?)
....rambling...

-Charlie