[physfs] physfs nonblocking bluesky.
Adam D. Moss
adam at gimp.org
Thu Dec 18 15:00:23 EST 2003
Hi Ryan, thanks for the info.
Ryan C. Gordon wrote:
> O_NONBLOCK, to my knowledge, won't help with CD-ROM seek time, but I
> could be wrong. I thought it was more for things like sockets where
> there could be an infinite delay waiting on more data.
I always thought so too, but my man page says that
O_NONBLOCK to an open() will also cause the open()
itself not to block (but leaves you guessing about
how you detect whether the open failed -- I guess
a EBADF on subsequent read attempts).
> Physfs is thread safe (or at least, should be) as long as you don't try
> to do i/o to the same file handle from two threads at once
Hmm, okay. I presume that's physical-filehandles rather than
physfs-filehandles. In that case guess it could be hard to tell
from the application level whether any two given physfs-filehandles
happen to correspond to the same physical-filehandle and thus
potentially be problematic, though.
> Different files (and even different handles to the same file) can be
> accessed in parallel, though, and other stuff, like directory access on
> the same .zip file, etc, is safe from multiple threads.
Ah, I think that's all I needed to hear... good news. So
the paragraph above was probably referring to physfs-filehandles
after all. Which is great. :)
Thanks,
--Adam
--
Adam D. Moss . ,,^^ adam at gimp.org http://www.foxbox.org/ co:3
Consume Less, Live More
More information about the physfs
mailing list