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.
7 More Discussions You Might Find Interesting
1. IP Networking
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
2. Post Here to Contact Site Administrators and Moderators
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
3. IP Networking
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
4. Forum Support Area for Unregistered Users & Account Problems
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. UNIX for Advanced & Expert Users
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
6. AIX
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
7. Shell Programming and Scripting
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
vwait(n) Tcl Built-In Commands vwait(n)
__________________________________________________________________________________________________________________________________________________
NAME
vwait - Process events until a variable is written
SYNOPSIS
vwait varName
_________________________________________________________________
DESCRIPTION
This command enters the Tcl event loop to process events, blocking the application if no events are ready. It continues processing events
until some event handler sets the value of variable varName. Once varName has been set, the vwait command will return as soon as the event
handler that modified varName completes. varName must be globally scoped (either with a call to global for the varName, or with the full
namespace path specification).
In some cases the vwait command may not return immediately after varName is set. This can happen if the event handler that sets varName
does not complete immediately. For example, if an event handler sets varName and then itself calls vwait to wait for a different variable,
then it may not return for a long time. During this time the top-level vwait is blocked waiting for the event handler to complete, so it
cannot return either.
EXAMPLES
Run the event-loop continually until some event calls exit. (You can use any variable not mentioned elsewhere, but the name forever
reminds you at a glance of the intent.)
vwait forever
Wait five seconds for a connection to a server socket, otherwise close the socket and continue running the script:
# Initialise the state
after 5000 set state timeout
set server [socket -server accept 12345]
proc accept {args} {
global state connectionInfo
set state accepted
set connectionInfo $args
}
# Wait for something to happen
vwait state
# Clean up events that could have happened
close $server
after cancel set state timeout
# Do something based on how the vwait finished...
switch $state {
timeout {
puts "no connection on port 12345"
}
accepted {
puts "connection: $connectionInfo"
puts [lindex $connectionInfo 0] "Hello there!"
}
}
SEE ALSO
global(n), update(n)
KEYWORDS
event, variable, wait
Tcl 8.0 vwait(n)