Re: [PHP4BETA] deadlock
| From: | Sascha Schumann | Date: | Sat, 25 Sep 1999 13:23:40 +0000 |
| Subject: | Re: [PHP4BETA] deadlock | ||
| References: | 1 2 3 4 5 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-4904@lists.php.net to get a copy of this message | ||
On Sat, Sep 25, 1999 at 02:39:43PM +0200, Andi Gutmans wrote:
> At 12:47 PM 9/25/99 +0200, Sascha Schumann wrote:
> >On Sat, Sep 25, 1999 at 12:37:12PM +0200, Andi Gutmans wrote:
> > > Hi,
> > >
> > > I think the .ctor in allocate_new_resource is the problem which is causing
> > > it. It should probably not be mutexed. I'm not sure about the
> > > tsrm_new_thread_(begin/end)_handlers handlers though.
> > > Try and unlock the mutex call in TSRM.c before line 191 and re-lock it
> > > after that line.
> >
> > Since the deadlock was happening when
> > tsrm_new_thread_begin_handler() was called, I've also added
> > unlock/lock pairs around begin_handler and end_handler. Now,
> > the deadlock does not happen anymore.
>
> OK. I'm waiting for Zeev to take a look at the code as he wrote TSRM. I
> think we can probably narrow the whole ts_resource() down to one pair of
> lock/unlock which will be the right way to fix it, but adding those
> unlock/lock's will at least allow you to continue development.
How does it come that this problem did not show up on other
platforms?
As a workaround, I modified TSRM earlier to use recursive
mutexes which avoids the deadlock situation. Unfortunately,
this is an unportable extension and depends on the platform
specific implementation.
--
Regards,
Sascha Schumann
Consultant