[python-win32] Ranged retrieval of large group membership lists

2010-03-12 Thread Mike Diehn
Hey folks, I can't be the only person dealing with this, right? I have an AD group of 1650 members. The find_group() function in active_directory.py can't return more than 1500 members. I've coded a generator that gets around it by using the query() method in a sort of brute force method. But

Re: [python-win32] Technique to limit number of instances of our application under Terminal Server

2010-03-12 Thread python
Hi Tim, Before continuing I want to express how grateful I am to you and all the others that have joined this thread. THANK-YOU, THANK-YOU, THANK-YOU! > Be aware of Christopher Nilsson's point that while the Mutex will be released > if the holding process crashes hard, the Semaphore will not rel

Re: [python-win32] Technique to limit number of instances of our application under Terminal Server

2010-03-12 Thread python
Hi Christopher, Thanks for your thoughts. I'm going to go back and re-test the semaphor strategy using Tim's sample code. My situation is very unusual in that the apps being run are often buggy because they are early releases of software being tested by a small team of testers. Our test team seem

Re: [python-win32] Technique to limit number of instances of our application under Terminal Server

2010-03-12 Thread Tim Golden
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

Re: [python-win32] Technique to limit number of instances of our application under Terminal Server

2010-03-12 Thread python
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. Regards, Malcolm - Original message - From: "Tim

Re: [python-win32] Technique to limit number of instances of our application under Terminal Server

2010-03-12 Thread python
Hi Link, > If the limit is one, then a lazy and dirty way is to bind to a tcp port (just pick a fixed one that's not used by other services - you could make it configurable), and exit if the bind fails. An excellent idea. I'm leaning towards either this idea or a collection of mutexes. Thanks

Re: [python-win32] Technique to limit number of instances of our application under Terminal Server

2010-03-12 Thread python
Hi Mark, > It sounds like you are after a named semaphore in the "Global\\" namespace. The semaphore count should work fine when your process terminates abnormally ... Thanks for your help. I'm experimenting with the semaphore concept and I think its possible for my semaphore counts to fall ou

Re: [python-win32] Technique to limit number of instances of our application under Terminal Server

2010-03-12 Thread python
Greg, Very clever! Thank you, Malcolm - Original message - From: "Greg Ewing" To: "zz Python Win32 Newsgroup" Date: Sat, 13 Mar 2010 00:15:19 +1300 Subject: Re: [python-win32] Technique to limit number of instances of our application under Terminal Server Here's another possible solu

Re: [python-win32] Technique to limit number of instances of our application under Terminal Server

2010-03-12 Thread Greg Ewing
Here's another possible solution. Each process tries to open a socket connection to a server process. When the maximum number of processes are connected, the server stops accepting connections. The server also selects all of its open connections for reading. When a process dies, the server will n

Re: [python-win32] Technique to limit number of instances of our application under Terminal Server

2010-03-12 Thread Tim Golden
On 12/03/2010 01:38, Christopher Nilsson wrote: Hi all, On 12 March 2010 02:31, Tim Golden wrote: The advantage of mutex's over semaphores would be that applications that terminate abnormally would have their mutex released, while applications using semaphors that terminated abnormally wo