08-07-2002
9,926,
461
Join Date: Aug 2001
Last Activity: 26 February 2016, 12:31 PM EST
Location: Ashburn, Virginia
Posts: 9,926
Thanks Given: 63
Thanked 461 Times in 270 Posts
Where to start?? The read() system call can block waiting for data, but you can set an option to prevent that. The pause() system csll will block until a signal arrives. And wait() can block until a process dies. In the real old days, that was it.
BSD added select() which can wait until one of several fd's have data available or until a timer expires. I really love select() personally and most versions of Unix have adopted it. The System V folks developed poll(), which I understand is like select.
BSD also added other system calls that can acquire data similiar to read(). These include recv(), recvfrom(), recvmsg(), and readv(). I'm probably leaving some out, but they all can block waiting for data.
There are various forms of IPC2that have been added to unix over the years and many of them can block. An example is msgrcv().
I have the feeling that I'm leaving some stuff out... The list may go on, but one thing that they all have in common is that one process is waiting for another process to do something.
I understand that linux has the ability to allow a process to ask the kernel for delivery of a signal if a file (including a directory) is updated. I don't use linux, but this sounds like an interesting feature.