RE: PROBLEM: close(fd) doesn't wake up read(fd) or select() in another thread

From: David Schwartz
Date: Sun Jul 16 2006 - 02:55:46 EST



> [1.] One line summary of the problem:
> close(fd) doesn't wake up read(fd) or select() in another thread

If you delete a resource in one thread while another thread is using it,
anything can happen. This is as serious a bug as calling 'free' on a block
of memory while another thread is using it.

You can never be sure the other thread was in 'read' or 'select' (as
opposed to being about to call it and then being pre-empted), so such code
will always have race conditions.

DS


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/