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

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

NAME
put - call a STREAMS put procedure SYNOPSIS
#include <sys/stream.h> #include <sys/ddi.h> void put(queue_t *q, mblk_t *mp); INTERFACE LEVEL
Architecture independent level 1 (DDI/DKI). PARAMETERS
q Pointer to a STREAMS queue. mp Pointer to message block being passed into queue. DESCRIPTION
put() calls the put procedure ( put(9E) entry point) for the STREAMS queue specified by q, passing it the message block referred to by mp. It is typically used by a driver or module to call its own put procedure. CONTEXT
put() can be called from a STREAMS module or driver put or service routine, or from an associated interrupt handler, timeout, bufcall, or esballoc call-back. In the latter cases, the calling code must guarantee the validity of the q argument. Since put() may cause re-entry of the module (as it is intended to do), mutexes or other locks should not be held across calls to it, due to the risk of single-party deadlock (put(9E), putnext(9F), putctl(9F), qreply(9F)). This function is provided as a DDI/DKI conforming replacement for a direct call to a put procedure. SEE ALSO
put(9E), freezestr(9F), putctl(9F), putctl1(9F), putnext(9F), putnextctl(9F), putnextctl1(9F), qprocson(9F), qreply(9F) Writing Device Drivers STREAMS Programming Guide NOTES
The caller cannot have the stream frozen when calling this function. See freezestr(9F). DDI/DKI conforming modules and drivers are no longer permitted to call put procedures directly, but must call through the appropriate STREAMS utility function, for example, put(9E), putnext(9F), putctl(9F), and qreply(9F). This function is provided as a DDI/DKI conforming replacement for a direct call to a put procedure. The put() and putnext() functions should be called only after qprocson() is finished. SunOS 5.11 28 Apr 1992 put(9F)
Man Page