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/2005-March/052251.html below:

[Python-Dev] thread semantics for file objects

[Python-Dev] thread semantics for file objects [Python-Dev] thread semantics for file objectsJeremy Hylton jhylton at gmail.com
Thu Mar 17 21:29:48 CET 2005
Are the thread semantics for file objecst documented anywhere?  I
don't see anything in the library manual, which is where I expected to
find it.  It looks like read and write are atomic by virtue of fread
and fwrite being atomic.

I'm less sure what guarantees, if any, the other methods attempt to
provide.  For example, it looks like concurrent calls to writelines()
will interleave entire lines, but not parts of lines.  Concurrent
calls to readlines() provide insane results, but I don't know if
that's a bug or a feature.  Specifically, if your file has a line that
is longer than the internal buffer size SMALLCHUNK you're likely to
get parts of that line chopped up into different lines in the
resulting return values.

If we can come up with intended semantics, I'd be willing to prepare a
patch for the documentation.

Jeremy
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