[Urwid] Urwid & threads.
Sascha Silbe
sascha-ml-ui-urwid at silbe.org
Sat Oct 18 17:59:35 EDT 2008
On Sat, Oct 18, 2008 at 03:06:45PM -0300, Martin Conte Mac Donell wrote:
> t.start()
> time.sleep(2000000)
> raise Exception("Why?")
>
> Exception is raised when i resize my xterm window. For some reason
> this action breaks time.sleep.
That's the way signals + threads work on a POSIX system. Signals from
other processes are delivered to a single, arbitrarily chosen thread
(see POSIX 2.4.1, "Signal Generation and Delivery" [2]). In your case
the main thread was chosen (but you cannot rely on that).
In the thread handling the signal the currently executed OS function
will usually abort and return with EINTR.
See also Entry #10 of the comp.programming.threads FAQ [1].
[1] http://www.faqs.org/faqs/threads-faq/part1/
[2]
http://www.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html
CU Sascha
--
http://sascha.silbe.org/
http://www.infra-silbe.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 481 bytes
Desc: Digital signature
Url : http://lists.excess.org/pipermail/urwid/attachments/20081018/44dcd65f/attachment.pgp
More information about the Urwid
mailing list