So, the question becomes: is it better to add "-timeout time" to all the
blocking subcommands, or to add "ns_mutex trylock"?  In theory,
"-timeout 0" should perform the trylock equivalent.

I'd vote for -timeout on all lock requests, as that way I get both the "see if lock is available" functionality, as well as "lock it if it's available, but give up after a few seconds if it isn't"

Generally, with any code I put into production, I try to put a sanity check in so that spectacular unexpected failures cause LOUD log warnings.,For normal semaphore locks, I might want to give up after 1 minute and display a warning in the log that there's likely a coding error in there (and I can even show a tcl stack trace to help find it). Otherwise, it's down to gdb and a core file to figure out what semaphores were blocking, and that's kind of ugly.

I'm currently using nsv_incr to emulate this behavior, and it works well enough.

-john


--
AOLserver - http://www.aolserver.com/

To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> 
with the
body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: 
field of your email blank.

Reply via email to