Vanilla List Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [VANILLA-LIST:2621] Re: SB e-temp bug



> Does anyone here have much experience with SYS V semaphores?
> I've implemented this test using semop(), but would appreciate some
> technical review.

Just got back from vacation.  Anyway, I'll take a look.

> Although the lock in the daemon was simple, the lock in ntserv either
> has to be in all sorts of odd places, or "inverted" around the wait
> for player input ... e.g.
> 
> unlock();
> wait-for-input();
> lock();
> 
> But that could lead to locks held if the ntserv stalls on a TCP write.
> Very bad.  Already it is a possibility the way I've coded it.

Well, you generally want to use a minimalist approach when acquiring
locks.  Also, did you account for all ntserv exit points (including
abnormal termination)?  If ntserv dies while holding locks, the whole
game will deadlock.

Dave
-- 
Dave Ahn <ahn@vec.wfubmc.edu>        |  "When you were born, you cried and the
                                     |  world rejoiced.  Try to live your life
Virtual Endoscopy Center             |  so that when you die, you will rejoice
Wake Forest Univ. School of Medicine |  and the world will cry."  -1/2 jj^2