Popular recipes tagged "blocking"http://code.activestate.com/recipes/tags/blocking/2010-09-06T11:20:53-07:00ActiveState Code RecipesSetting a file descriptor to blocking or non-blocking mode (C)
2010-09-06T11:20:53-07:00Emilio Montihttp://code.activestate.com/recipes/users/4173642/http://code.activestate.com/recipes/577384-setting-a-file-descriptor-to-blocking-or-non-block/
<p style="color: grey">
C
recipe 577384
by <a href="/recipes/users/4173642/">Emilio Monti</a>
(<a href="/recipes/tags/blocking/">blocking</a>, <a href="/recipes/tags/file_descriptor/">file_descriptor</a>, <a href="/recipes/tags/non_blocking/">non_blocking</a>).
Revision 2.
</p>
<p>A simple function to set a file descriptor (i.e. a socket) to blocking or non-blocking mode.</p>
GtkWorker (Python)
2007-06-03T09:06:42-07:00Thomas Ahlehttp://code.activestate.com/recipes/users/4060075/http://code.activestate.com/recipes/521881-gtkworker/
<p style="color: grey">
Python
recipe 521881
by <a href="/recipes/users/4060075/">Thomas Ahle</a>
(<a href="/recipes/tags/blocking/">blocking</a>, <a href="/recipes/tags/glib/">glib</a>, <a href="/recipes/tags/gtk/">gtk</a>, <a href="/recipes/tags/swingworker/">swingworker</a>, <a href="/recipes/tags/threads/">threads</a>).
</p>
<p>I got inspired to this class, after having read about the java SwingWorker.
The problem is that you sometimes have a tough task you want to do in a GUI program, but you don't want the UI to lock.
This recipe solves the problem by running the tough code in a background thread, while still letting you do useful interaction with it, like getting the progress or the latest results.</p>