A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2007-January/070828.html below:

[Python-Dev] Problem with signals in a single threaded application

[Python-Dev] Problem with signals in a single threaded application [Python-Dev] Problem with signals in a single threaded applicationUlisses Furquim ulissesf at gmail.com
Sun Jan 28 02:18:00 CET 2007
On 1/27/07, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> > Why not?
>
> Correct me if I'm wrong, but what I got from the OP
> was that the current method does
>
>    if (is_tripped) {
>      for each signal {
>        if the signal has occurred, call its handler
>      }
>      is_tripped = 0;
>    }
>
> and the problem is that any setting of is_tripped that
> occurs in the midst of calling the handlers gets
> wiped out at the end.
>
> Changing this to
>
>    while (is_tripped) {
>      for each signal {
>        if the signal has occurred, call its handler
>      }
>      is_tripped = 0;
>    }
>
> doesn't solve that, because is_tripped still gets
> set to 0 before it's tested again.

Agreed.

> Thinking about it more, probably it doesn't. What's
> important is to clear it *before* testing whether any
> handlers need to be called, i.e.
>
>    if (is_tripped) {
>     is_tripped = 0;
>     for each signal {
>        if the signal has occurred, call its handler
>      }
>    }
>

That's exactly what my patch does as you can see here:

http://www.python.org/sf/1643738

Regards,

-- Ulisses
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4