releasing file descriptors with the tty layer

2 views
Skip to first unread message

Mike Frysinger

unread,
May 3, 2007, 11:14:51 AM5/3/07
to Kernel Newbies
if you have a multithreaded application and more than one thread is
operating on a file descriptor which represents a tty device at the
same time (one is used to polling it while another is used to interact
with it via read/write), doing a close() operation on the file will
not actually release the file descriptor in the kernel until all
things referencing it have completed (like the select()) ?

for example, say a background thread is doing select() on the fd while
another thread does close() followed by open() ... it is possible for
the close()/open() sequence on the tty to complete before the select()
is signaled and finishes ? so in the tty layer, you'd see tty_open
called (via the open()) before tty_close (via the close() and the
select()) ?
-mike

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to eca...@nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ

Reply all
Reply to author
Forward
0 new messages