why no ++?

Markus Schaber markus at schabi.de
Tue Aug 7 23:00:34 CEST 2001


Hi,

Alex Martelli <aleaxit at yahoo.com> schrub:

>> Eiffel goes even further with this, for example:
>>
>> fp.read_line
>> s := fp.last_string
>>
>> I haven't decided yet if this consistency is of the hobgoblin variety
>> or not.
> 
> To me, it seems cleverly designed to maximize threading
> problems/race-conditions/horrid-bugs.

Only when you consider that in a Python/C/Java-like 
  s = fp.read_line()
the internal implementation of fp.read_line() is guaranteed to be 
atomary in execution.

This may be the case in stackles pyhton green threads, and in java 
using synchronized, but is not the general case.

The most often solution is that read_line() internally does some 
locking, or specifies in the documentation that only one thread at a 
time uses it.

markus
-- 
Defend democrathy and freedom!



More information about the Python-list mailing list