More fun with file descriptors
Posted Jun 14, 2007 16:15 UTC (Thu) by zlynx
In reply to: More fun with file descriptors
Parent article: More fun with file descriptors
I believe the context of the whole file descriptor discussion involves threading and the bad performance of high file descriptors.
If your library wants to dup2 a high file descriptor, another library could be trying the same trick in another thread and screw up the whole thing if it happened at just the right point between your fstat and the dup.
The performance problems happen because of the way file descriptors are handled in-kernel.
to post comments)