[PD-dev] 0.43 startup procedure and vwait WAS: [PATCH 06/10] fixed race-condition in the audio/midi API initialization
Hans-Christoph Steiner
hans at at.or.at
Thu Jul 15 16:46:46 CEST 2010
On Jul 15, 2010, at 10:28 AM, IOhannes zmölnig wrote:
> On 07/15/2010 04:21 PM, Hans-Christoph Steiner wrote:
>
>>
>> The options are wait forever or have a timeout. The vwait code
>> provides
>> a timeout. I am fine with having a long timeout for the conditions
>> you
>> describe but it would be harmful to not have a timeout because then
>> you'll have a pd-gui process that is just sitting there waiting
>> forever
>> for pd to show up whether or not if ever will. As some point pd-gui
>> should tell you that its not likely to happen and just quit.
>
> my approrach was not to wait at all, and as soon as pd shows up
> dynamically incorporate the info.
> no timeout, no waiting, no deadlock no racecondition.
The vwait timeout would not be needed if we can rely on 'pd' to
actually fully die when it exits/crashes. On Mac OS X at least it is
often doesn't completely crash and the process just sits there doing
who knows what. If this happens on startup, pd-gui's exec call will
not return, and pdtk_pd_startup won't be called and pd-gui will just
sit and wait forever, giving us a zombie pd-gui. The vwait stuff
wouldn't be needed if we can rely of pd to exit completely on all
platforms. Just removing the vwait stuff is just replacing one
problem with another.
>>
>> For this reason, I think its a bad idea to get rid of the vwait
>> code and
>> move stuff to pdtk_pd_startup. If there are bugs with the vwait
>> approach, I'd be happy to fix them. For what IOhannes describes
>> here,
>> it sounds like the timeout just needs to be increased. Perhaps there
>
> i experienced a race-condition! please do not fix race-conditions by
> increasing a timeout.
>
> fgmar
> IOhannes
Relax, no one is suggesting fixing a race condition with a timeout.
Can you describe how to reproduce the race condition? What's actually
racing? Did Miller's changes fix it?
.hc
----------------------------------------------------------------------------
I have the audacity to believe that peoples everywhere can have three
meals a day for their bodies, education and culture for their minds,
and dignity, equality and freedom for their spirits. - Martin
Luther King, Jr.
More information about the Pd-dev
mailing list