race condition
Lei Zhang <[email protected]> Fri, 09 Jan 2004 18:49:17 -0800
| Newsgroups | gmane.network.beep.beepcore.c.general |
|---|---|
| Message-ID | <[email protected]> |
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?
Thanks,
Lei
William J. Mills wrote:
>Fair enough. :)
>
-------------------------------------------------------
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