Rommel Dongre <email@example.com> wrote:
I have some queries regarding the cleanup of file descriptors (or
connection ids) by a resource manager handling those connections.
If a process terminates, without close()ing all open fds, is an
_IO_CLOSE message still generated and sent to the resouorce manager?
How does a resource manager (say a filesystem resource manager) get
notified about a process crashing, while still having open fds (which
might have locks).
What is the status of such coids, on a crash?
Everything will be closed up when the process exits - the kernel will
detach them if the process does not. There is another case - what happens
when a process dies that is blocking on your resmgr? The resmgr channel
is created with the flag _NTO_CHF_UNBLOCK. This means when a client would
normally unblock it isn’t and you get an unblock pluse (iofunc_unblock)
which allows you to clean-up and unblock the client normally.
Then it unblocks and continues on doing whatever caused it to unblock.
Take a look at the flags in the help for ChannelCreate(). And the call
to ChannelCreate() in lib/c/dispatch/dispatch.c. (it is on cvs.qnx.com).
Chris McKillop <firstname.lastname@example.org> “The faster I go, the behinder I get.”
Software Engineer, QSSL – Lewis Carroll –