Tim Golden
Fri, 12 Mar 2010 06:32:35 -0800
On 12/03/2010 14:21, pyt...@bdurham.com wrote:
Tim, Thank you for your example code and ideas!! I think my earlier experiments with semaphores may be the result of my poor code vs. your approach :) I'm going to put aside my pool of mutex's idea and experiment with your sample code.
Good luck. Be aware of Christopher Nilsson's point that while the Mutex will be released if the holding process crashes hard, the Semaphore will not release its token. (Haven't tried this myself; I'm assuming he's had experience or has read the docs more carefully than me). The bind-to-a-socket approach is a good general-purpose solution. (It can be used on any socket-based system where binding semantics disallow simultaneous connections). Greg Ewing's "control server" is the kind of thing you'd be doing for license control, eg, and has the advantage he points out about detecting dead session. But it has the overhead of a control process. Which may or may not be an issue for you. TJG _______________________________________________ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32