stream_MT man page on SunOS

Man page or keyword search:  
man Server   20652 pages
apropos Keyword Search (all sections)
Output format
SunOS logo
[printable version]

stream_MT(3CC4)						       stream_MT(3CC4)

NAME
       stream_MT  -  base  class to provide dynamic changing of iostream class
       objects to and from MT safety.

SYNOPSIS
       #include <rlocks.h>
       typedef char stream_bool_t;

       class stream_MT {
       public:
	    enum { unsafe_object=0, safe_object=1 };
	    stream_MT();
	    stream_MT(stream_bool_t);
	    stream_bool_t test_safe_flag();
	    void set_safe_flag(stream_bool_t);
	    friend class stream_locker;
       };

DESCRIPTION
       Class stream_MT is a base class that allows  the	 iostream  classes  in
       libC to work correctly in a multi-threaded environment. The classes ios
       and streambuf are derived from stream_MT.

       The multi-thread (MT) safety of an iostream object can  be  dynamically
       changed	 by   setting	a   safe   flag	 using	the  member  function:
       set_safe_flag(). An argument with the value  of	stream_MT::safe_object
       sets  the  iostream object to be MT safe, an argument with the value of
       stream_MT::unsafe_object sets the object to be MT-unsafe.  The  current
       state  of the iostream object can be determined by the member function:
       test_safe_flag(). When an iostream object is MT safe there is a certain
       amount  of overhead associated with internal locking in the object. The
       overhead can be avoided by setting the safe flag to zero which disables
       internal locking.

   Constructors
       stream_MT();

	      By  default  the	safe_flag  of  the  class  object  is  set  to
	      stream_MT::safe_object

       stream_MT(stream_bool_t);

	      The default can be changed by providing an  explicit  value  for
	      the safe flag.

   Member functions
       stream_bool_t test_safe_flag();

	      Returns  the  current value of the safe flag. A value other than
	      stream_MT::unsafe_object indicates the  iostream	object	is  MT
	      safe and locking is enabled.

       void set_safe_flag(stream_bool_t);

	      Sets  the internal safe flag of the iostream object to the value
	      given as an argument. Setting  the  value	 to  non-zero  enables
	      locking  and makes the object MT safe. Setting the value to zero
	      does the reverse.

SEE ALSO
       C++ Library Reference

	       Chapter 4, "Using Classic iostream in a Multithreaded  Environā€
       ment."

				 18 June 1998		       stream_MT(3CC4)
[top]

List of man pages available for SunOS

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net