Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

freezestr(9f) [sunos man page]

freezestr(9F)						   Kernel Functions for Drivers 					     freezestr(9F)

NAME
freezestr, unfreezestr - freeze, thaw the state of a stream SYNOPSIS
#include <sys/stream.h> #include <sys/ddi.h> void freezestr(queue_t *q); void unfreezestr(queue_t *q); INTERFACE LEVEL
Architecture independent level 1 (DDI/DKI). PARAMETERS
q Pointer to the message queue to freeze/unfreeze. DESCRIPTION
freezestr() freezes the state of the entire stream containing the queue pair q. A frozen stream blocks any thread attempting to enter any open, close, put or service routine belonging to any queue instance in the stream, and blocks any thread currently within the stream if it attempts to put messages onto or take messages off of any queue within the stream (with the sole exception of the caller). Threads blocked by this mechanism remain so until the stream is thawed by a call to unfreezestr(). Drivers and modules must freeze the stream before manipulating the queues directly (as opposed to manipulating them through programmatic interfaces such as getq(9F), putq(9F), putbq(9F), etc.) CONTEXT
These routines may be called from any stream open, close, put or service routine as well as interrupt handlers, callouts and call-backs. SEE ALSO
Writing Device Drivers STREAMS Programming Guide NOTES
The freezestr() and unfreezestr() functions can have a serious impact on system performance. Their use should be very limited. In most cases, there is no need to use freezestr() and there are usually better ways to accomplish what you need to do than by freezing the stream. Calling freezestr() to freeze a stream that is already frozen by the caller will result in a single-party deadlock. The caller of unfreezestr() must be the thread who called freezestr(). STREAMS utility functions such as getq(9F), putq(9F), putbq(9F), and so forth, should not be called by the caller of freezestr() while the stream is still frozen, as they indirectly freeze the stream to ensure atomicity of queue manipulation. SunOS 5.10 17 Oct 2000 freezestr(9F)

Check Out this Related Man Page

qprocson(9F)						   Kernel Functions for Drivers 					      qprocson(9F)

NAME
qprocson, qprocsoff - enable, disable put and service routines SYNOPSIS
#include <sys/stream.h> #include <sys/ddi.h> void qprocson(queue_t *q); void qprocsoff(queue_t *q); INTERFACE LEVEL
Architecture independent level 1 (DDI/DKI). PARAMETERS
q Pointer to the RD side of a STREAMS queue pair. DESCRIPTION
qprocson() enables the put and service routines of the driver or module whose read queue is pointed to by q. Threads cannot enter the mod- ule instance through the put and service routines while they are disabled. qprocson() must be called by the open routine of a driver or module before returning, and after any initialization necessary for the proper functioning of the put and service routines. qprocson() must be called before calling put(9F), putnext(9F), qbufcall(9F), qtimeout(9F), qwait(9F), or qwait_sig(9F). qprocsoff() must be called by the close routine of a driver or module before returning, and before deallocating any resources necessary for the proper functioning of the put and service routines. It also removes the queue's service routines from the service queue, and blocks until any pending service processing completes. The module or driver instance is guaranteed to be single-threaded before qprocson() is called and after qprocsoff() is called, except for threads executing asynchronous events such as interrupt handlers and callbacks, which must be handled separately. CONTEXT
These routines can be called from user or interrupt context. SEE ALSO
close(9E), open(9E), put(9E), srv(9E), put(9F), putnext(9F), qbufcall(9F), qtimeout(9F), qwait(9F), qwait_sig(9F) Writing Device Drivers STREAMS Programming Guide NOTES
The caller may not have the STREAM frozen during either of these calls. SunOS 5.10 11 Nov 1992 qprocson(9F)
Man Page