VM and non-blocking writes
Wayne Christopher
wayne@4raccoons.com
Thu Dec 13 19:16:00 GMT 2007
Okay, here's my test program. Compile and run with no arguments, then
connect to it from another machine - on a linux box I just did:
python
import socket
s = socket.socket()
s.connect(("name-of-windows-box", 12345))
At this point, nbcheck printed:
listening to port 12345 on host xp1 (10.1.2.40)
got connection from 10.1.2.14
trying to write 100000000
100000000 bytes written
When I hit return to exit from nbcheck, it does not actually exit until
the remote socket is closed.
The VM usage is 100M, which is all the data array that I allocated, so
it doesn't look like the write() call allocated anything in my process
space.
This behavior makes some sense to me, but it's not how I expect it to
work (based on the write(2) man page and how it works on linux). It's
more like asynchronous write than non-blocking write. Using O_NONBLOCK
instead of O_NDELAY doesn't change the behavior.
Thanks,
Wayne
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nbcheck.c
Type: text/x-c++src
Size: 1785 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20071213/2c595573/attachment.bin>
-------------- next part --------------
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
More information about the Cygwin
mailing list