Popular recipes by Benjamin Peterson http://code.activestate.com/recipes/users/4170802/2011-07-02T18:42:08-07:00ActiveState Code RecipesSleepsort with processes and pipes (Python) 2011-06-17T02:37:58-07:00Benjamin Petersonhttp://code.activestate.com/recipes/users/4170802/http://code.activestate.com/recipes/577758-sleepsort-with-processes-and-pipes/ <p style="color: grey"> Python recipe 577758 by <a href="/recipes/users/4170802/">Benjamin Peterson</a> (<a href="/recipes/tags/process/">process</a>, <a href="/recipes/tags/sorting/">sorting</a>, <a href="/recipes/tags/unix/">unix</a>). Revision 2. </p> <p>Sleepsort is a sorting algorithm that uses the system sleep syscall in a very creative fashion.</p> <p>This is the same algorithm as <a href="http://code.activestate.com/recipes/577756/">recipe 577756</a> but using *nix processes instead of threads.</p> Calling (C-level) finalizers without __del__ (Python) 2011-07-02T18:42:08-07:00Benjamin Petersonhttp://code.activestate.com/recipes/users/4170802/http://code.activestate.com/recipes/577242-calling-c-level-finalizers-without-__del__/ <p style="color: grey"> Python recipe 577242 by <a href="/recipes/users/4170802/">Benjamin Peterson</a> (<a href="/recipes/tags/ctypes/">ctypes</a>, <a href="/recipes/tags/finalization/">finalization</a>, <a href="/recipes/tags/weakref/">weakref</a>). Revision 3. </p> <p>This recipe is meant for Python classes wrapping ctypes bindings where a C-level finalizer must be invoked when the wrapper is destroyed. It uses weakref callbacks to avoid problems with <code>__del__</code>.</p>