Popular recipes by Michael Robin http://code.activestate.com/recipes/users/116793/2002-06-06T16:07:11-07:00ActiveState Code RecipesManaging thread lifetime (Python)
2001-10-18T21:12:51-07:00Michael Robinhttp://code.activestate.com/recipes/users/116793/http://code.activestate.com/recipes/82235-managing-thread-lifetime/
<p style="color: grey">
Python
recipe 82235
by <a href="/recipes/users/116793/">Michael Robin</a>
(<a href="/recipes/tags/threads/">threads</a>).
Revision 2.
</p>
<p>If you're familiar with thread programming, Python is reasonably straightforward to work with, once you realize the global interpreter lock is around; however, sometimes they can be trouble. One case is when threads don't die when you expect them to. Resorting to infrequent polling, even if more advanced logic is active in your program, is one way to deal with this, especially during debugging.</p>
Flexible Win32 message pump using MsgWaitForMultipleObjects (Python)
2002-06-06T16:07:11-07:00Michael Robinhttp://code.activestate.com/recipes/users/116793/http://code.activestate.com/recipes/82236-flexible-win32-message-pump-using-msgwaitformultip/
<p style="color: grey">
Python
recipe 82236
by <a href="/recipes/users/116793/">Michael Robin</a>
(<a href="/recipes/tags/threads/">threads</a>).
Revision 3.
</p>
<p>In win32, as in other event-driven systems, you must process messages or bad things happen.
(Or at best, good things don't happen.) The MsgWaitForMultipleObjects is one way to deal
with handling messages as well as coordinating several other activities.</p>
Compile-time regex's and pattern-based dispatching (Python)
2001-10-31T23:11:35-08:00Michael Robinhttp://code.activestate.com/recipes/users/116793/http://code.activestate.com/recipes/82585-compile-time-regexs-and-pattern-based-dispatching/
<p style="color: grey">
Python
recipe 82585
by <a href="/recipes/users/116793/">Michael Robin</a>
(<a href="/recipes/tags/text/">text</a>).
Revision 4.
</p>
<p>Although python has no literal representation for compiled
regular expressions (which is good) you can compile them
at Python read/compile-time. You can also use regexs to
match strings and automatically call funtions with arguments
that are based on the groups of the matched strings.</p>