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/2003-February/033077.html below:

[Python-Dev] Why did Fredrik leave the party?)

Atomic operations (was Re: [Python-Dev] Why did Fredrik leave the party?) Atomic operations (was Re: [Python-Dev] Why did Fredrik leave the party?)Barry A. Warsaw barry@python.org
Thu, 6 Feb 2003 09:11:47 -0500
>>>>> "ESR" == Eric S Raymond <esr@thyrsus.com> writes:

    ESR> I'm going to have to come out against this idea.  I think it
    ESR> violates "explicit is better than implicit", and is
    ESR> perilously close to being mere syntactic sugar.

Except that it's not, because of the lack of atomic acquire-and-enter-try.

You could probably code this specific example like so:

    try:
	lock.acquire()
	dosomething()
    finally:
	try:
	    lock.release()
	except NotLocked:
	    pass

but you still have the problem of ironclad resource release in
other situations, such as the cursor opening scenario (I think) I
posted before.

Brett (I think) suggested that there may be alternatives to a
syntactic approach, e.g. one that prohibits thread switching between
the resource acquisition and the entering of the try.  That might be
interesting to explore, but I worry about deadlock possibilities.

-Barry



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