From: Avdi Grimm Date: 2013-09-30T18:17:43-04:00 Subject: [ruby-core:57501] Re: [CommonRuby - Feature #8556] MutexedDelegator as a trivial way to make an object thread-safe --089e011827aeb40d9304e7a13536 Content-Type: text/plain; charset=ISO-8859-1 On Mon, Sep 30, 2013 at 5:13 PM, headius (Charles Nutter) < headius@headius.com> wrote: > and the code should use Monitor instead of Mutex so it can be reentrant. I'm trying to think of a case in which this would matter. Since it's wrapping another object, we don't have to worry about the case where a synced method calls another synced method on self. Hmmm... I guess there's the case where synced_obj.foo receives a block, and someone calls synced_obj.bar within that block. I only bring this up because Monitor introduces a (small?) performance hit over Mutex. -- Avdi Grimm http://avdi.org I only check email twice a day. to reach me sooner, go to http://awayfind.com/avdi --089e011827aeb40d9304e7a13536 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

= On Mon, Sep 30, 2013 at 5:13 PM, headius (Charles Nutter) <headius@headi= us.com> wrote:
and the code should use Monitor instead of M= utex so it can be reentrant.

I'm trying to think = of a case in which this would matter. Since it's wrapping another objec= t, we don't have to worry about the case where a synced method calls an= other synced method on self.

Hmmm... I g= uess there's the case where synced_obj.foo receives a block, and someon= e calls synced_obj.bar within that block.
<= br>
I only bring this up because Monitor intro= duces a (small?) performance hit over Mutex.

--
Avdi Grimm
http:/= /avdi.org

I only check email twice a day. to reach me sooner, go to http://awayfind.com/avdi
--089e011827aeb40d9304e7a13536--