In article <20111228124228.c4d8614a...@mail.netbsd.org>, YAMAMOTO Takashi <y...@mwd.biglobe.ne.jp> wrote: >hi, > >> On Dec 21, 5:07am, y...@mwd.biglobe.ne.jp (YAMAMOTO Takashi) wrote: >> -- Subject: Re: CVS commit: src/sys >> >> | why? >> | i thought the reason of having this as a separate member was performance. >> >> All the code paths that use NBIO check bits in so_state... I would like to >> see the benchmark that proves this. > >it's about the fcntl side, for which you added more locking. >
For FIONBIO... Even if you construct a synthetic benchmark that turns on and off blocking I/O for a socket continuously, and the locking overhead proves to be larger than the system call overhead (which it may very well be), I doubt that you'll find any real program that calls ioctl(so, FIONBIO, ...) frequently enough to make a difference. I really think that Andy confused it with FIONREAD (hence the comment), which can be called quite frequently (and it is still unlocked). christos