Re: [PATCH] Don't use select on files under windows



On Wed, Apr 15, 2009 at 11:57 PM, Stephen Kennedy <stevek gnome org> wrote:
>> select.select() does not work on files under windows,
>> use a dummy function instead.
>
> Maybe a small sleep to avoid being a hog?

I just realized we'll do a blocking read() just after that
false select(), so we won't be a CPU hog.

But we may very well be open to deadlocks.

For example if we end up doing a stdin.read() when
there's nothing to read because there has been an error
and the filedesc to read is stderr.

Reproduce with something like:

$ dd if=/dev/zero of=zeroed bs=1M count=100
$ sync
$ python -c 'import subprocess; subprocess.Popen(["cat", "zeroed"],
stdout=subprocess.PIPE, stderr=subprocess.PIPE).stderr.read(16384)'

this stays blocked, in another shell do:

$ ps aux | awk '/[s]ubprocess/ {print $2}'
11481
$ cat /proc/11481/wchan ; echo
pipe_wait

This is probably what I've already seen happening under
windows. I'll investigate a bit more...

In the mean time I retract that patch from submission.
It is clearly wrong to read() on a pipe with no data
coming...

Don't hold off the release waiting for working windows
support. We won't have it in the near future...

I also found that we will need to do things to keep
CR/LF consistent in a file. Subversion chokes on mixed
line endings...

-- 
Vincent Legoll


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]