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/2002-September/028604.html below:

Two random and nearly unrelated ideas)

[Python-Dev] Signal-resistant code (was: Two random and nearly unrelated ideas)Oren Tirosh oren-py-d@hishome.net
Thu, 5 Sep 2002 08:27:37 +0300
On Wed, Sep 04, 2002 at 04:48:11PM -0400, Guido van Rossum wrote:
> [Jack]
> > Hmm, and when I think of it I don't think it's even possible to restart 
> > safely. What if I do a read() on a socket, and I request more bytes 
> > than the available physical memory (but less than VM, of course)? The 
> > kernel simply doesn't have anywhere to store the bytes other than my 
> > buffer, and if it has to return EINTR then >POOF< these bytes are gone 
> > forever.
> 
> I think that if any bytes have already been copied into your buffer,
> you don't get an EINTR, you get a short read.

>From read(2) man page:

   EINTR  The call was interrupted by a signal before any data was read.

Same applies to write, recv, fcntl with locks, semop, etc. They're all 
designed to be restartable. The keyword in all cases is "before".

	Oren




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