RE: Threading issue

Helen Ryan <[email protected]> Mon, 23 Dec 2002 09:52:03 -0000
Newsgroups gmane.network.beep.beepcore.c.general
Message-ID <[email protected]>
yes, someone else thought this looked wrong too - see the patch
bp_fcbeeptcp_mutex.patch.txt
-----Original Message-----
From: Des Smith [mailto:[email protected]]
Sent: 18 December 2002 08:46
To: [email protected]
Cc: [email protected]
Subject: [Beepcore-c-users] Threading issue


I find that intermittently the fiostate_unblock_write() is hanging as
something is holding onto the 
 
ios->pn->lock. 
 
Im using gdb and looking at the process threads. Looking at the code I
noticed that in the file
 
bp_fcbeeptcp.c in the 'notify_Lower' routine I see the following lines 
 
 
Notify_lower()
{
            .....
            .....
            .....
            ....
 
case 3:
                SEM_POST(&thisio->lock);  
                if (thisio->state >= IOS_STATE_ACTIVE)
                    thisio->state=IOS_STATE_WRITE_PENDING;
                SEM_POST(&thisio->lock);
                fiostate_unblock_write(thisio);
                break;
            default:
 
}
 
To me this doesn't look right. Ie it looks like you should have
SEM_WAIT(&thisio->lock) after the case statement.
 
Using gdb by printing the ios-pn->lock variable ie see a count of 17. Could
this be causing the hanging? 
 
Has only else seen this behaviour? 
 
Thanks for your help
Des Smith.