Function in a blocked state.

Thread Tools Search this Thread
Top Forums Programming Function in a blocked state.
# 1  
Old 08-07-2002
Function in a blocked state.


How do you write a function which has to stay blocked in a wait state till an event occurs?

The event could be the arrival of a message/updation of a database etc ..

# 2  
Old 08-07-2002
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.
# 3  
Old 08-08-2002
Thanks Perderabo.

Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Vim function to generate RTL Code(finite state machine) in verilog

Hi I wanted to call the AutoFsm function (given below) in vim to generate a code something like: **********verilog code to generate ************* always @(posedge clk or negedge rst_n) begin if(!rst_n) begin state_r <= #1 next_stateascii_r; ... (0 Replies)
Discussion started by: dll_fpga
0 Replies

2. AIX

Open firmware state to running state

Hi Admins, I am having a whole system lpar in open firmware state on HMC. How can I bring it to running state ? Let me know. Thanks. (2 Replies)
Discussion started by: snchaudhari2
2 Replies

3. UNIX for Advanced & Expert Users

How to remove the Blocked content!!

Dear Team, Please find the screen shot , which shows the attacked page of of my website, people saying using the webmaster tool only we can remove this malicious code. but is it possible to remove the malicious code directly login in to the server , its a dedicated server and... (2 Replies)
Discussion started by: anishkumarv
2 Replies

4. Forum Support Area for Unregistered Users & Account Problems

Re: Reg Email Blocked. Pt II

Thanks for replying Neo. For some reason I cannot reply in a thread without registering, but I can start a new thread so I apologize for this extra thread. my email ...(at)email(dot)com (1 Reply)
Discussion started by: Goatfarmer03
1 Replies

5. IP Networking

Blocked ports

I have installed a network camera in my home which i would like to watch when i am in my office.The problem is that the specific port that is used from my camera to pass video is blocked by my isp(as most ports for incoming connections). It is not possible to change that port from my camera... (3 Replies)
Discussion started by: link7722
3 Replies

6. Post Here to Contact Site Administrators and Moderators

IP Blocked

When I try to view these forums from work, I get a message that my IP has been blocked. Please advise as to how to fix this situation. My IP at work comes from the following class B network: 128.226.X.X (Binghamton University) Thanks. (1 Reply)
Discussion started by: debcav
1 Replies

7. IP Networking

BitTorrent port 6969 blocked... how to get around the blocked port

Due to the massive Upload speeds killing .... or overstressing our schools network...... my school has blocked port 6969 (the most common BitTorrent port). So I cant connect to the tracker anymore, in other words no more downloading from school :( Does anyone know how I can get around the ports... (1 Reply)
Discussion started by: PenguinDevil
1 Replies
Login or Register to Ask a Question