A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2006-March/062351.html below:

[Python-Dev] Threading idea -- exposing a global thread lock

[Python-Dev] Threading idea -- exposing a global thread lock [Python-Dev] Threading idea -- exposing a global thread lockPhillip J. Eby pje at telecommunity.com
Tue Mar 14 05:06:49 CET 2006
At 09:57 PM 3/13/2006 -0500, Raymond Hettinger wrote:
>FWIW, the new with-statement makes the above fragment even more readable:
>
>     with atomic_transaction():
>         # do a series of steps without interruption

+1 on the idea, -1000 on the name.  It's neither atomic nor a 
transaction.  I believe that "critical section" is a more common term for 
what you're proposing.

Probably the primitive could be placed in the thread or threading module, 
so that it would be something like:

     with threading.critical_section():
         # ...

It might be nice to be able to escape out of the critical section using a 
nested with: statement, as this would allow you to treat much of a program 
as single-threaded, and then selectively allow task switching.  But I'm not 
sure what you'd call that API.  :)

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