Re: race condition

Lei Zhang <[email protected]> Fri, 09 Jan 2004 19:20:49 -0800
Newsgroups gmane.network.beep.beepcore.c.general
Message-ID <[email protected]>
bummer, scratch that.  It's my bad, I modified 
waitfor_chan_stat_quiescent() to debug another problem... sorry about 
the fuss.

Lei Zhang wrote:

> Just tripped over another beepcore-c problem: race condition at 
> session shutdown time.  I'm gonna use null-profile.c to explain the 
> problem:
>
> In null-profile.c:
> pro_frame_available ()
> {
> 1.    f = bpc_query_frame(...)
>
> 2.    /* do fancy processing */
>
> 3.    bpc_frame_destroy();
> }
>
> In 2. a RPY can be sent to acknowlege a MSG; now the channel 0 thread 
> takes over and destroys the null-profile channel instance (because the 
> channel is considered QUIESCENT); now back to the above 3, bummer!! 
> core dump on GET_WRAPPER(inst->conn) then grabbing wrap->core_lock!
>
> I'm now just working around this by doing bpc_frame_destroy() before 
> sending RPY.  Any better/real fix?
>





-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html