E&S CVS Commit: PEAK - Change to binding.Once: if the object's dict contains 'NOT_FOUND' as the

pje at eby-sarna.com pje at eby-sarna.com
Sat Feb 22 11:22:00 EST 2003


Module Name:	PEAK
Committed By:	pje
Date:		Sat Feb 22 16:21:48 UTC 2003

Modified Files:
	PEAK/src/peak/binding: _once.c _once.pyx

Log Message:
Change to binding.Once: if the object's dict contains 'NOT_FOUND' as the
bound attribute's value, 'AttributeError' is raised upon access.  This lets
you override a bound attribute value and declare it non-existent, and it
also ensures that a circularly defined attribute will result in an error
message.

Unfortunately, an error will also result if two threads attempt
to access and compute the bound attribute "at the same time".  But this
is a slight improvement over the situation prior to this change, where a
race condition would cause the "losing" thread to silently return
'NOT_FOUND', possibly causing the problem to lurk awhile.

The existence of this race condition is a potentially serious problem with
the use of lazy attribute bindings in class objects (which are shared
between threads), and it may be that we will need to require some type of
locking for such bindings.  :(


To view diffs of this commit, you can use the following URL(s):
http://cvs.eby-sarna.com/PEAK/src/peak/binding/_once.c.diff?r1=1.1&r2=1.2
http://cvs.eby-sarna.com/PEAK/src/peak/binding/_once.pyx.diff?r1=1.1&r2=1.2

To generate a diff of this commit:
cvs rdiff -r1.1 -r1.2 PEAK/src/peak/binding/_once.c \
    PEAK/src/peak/binding/_once.pyx

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




More information about the source-changes mailing list