Feature Selection Toolbox FST4
UTIA · Czech Academy of Sciences
Loading...
Searching...
No Matches

Serializes textual reporting from concurrent threads. More...

#include <global.hpp>

Static Public Member Functions

static void print (std::ostream &os, std::ostringstream &sos)
 Writes sos's buffered content to os, serializing concurrent writers under FST_THREADED via a shared mutex.

Static Private Member Functions

static std::mutex & get_io_mutex ()
 Returns the process-wide mutex guarding concurrent output via print() (FST_THREADED builds only).

Detailed Description

Serializes textual reporting from concurrent threads.

The class holds no state and is never instantiated (the constructor is private); it exists only as the scope of the static print() service and of the mutex that guards it. Every output produced from code that may run inside a threaded search must go through syncout::print() – writing to std::cout directly from several threads interleaves characters and, in the worst case, stalls the reporting.

Member Function Documentation

◆ print()

void FST::syncout::print ( std::ostream & os,
std::ostringstream & sos )
inlinestatic

Writes sos's buffered content to os, serializing concurrent writers under FST_THREADED via a shared mutex.

Parameters
osthe output stream to write to
sosthe buffered message content to flush

The documentation for this class was generated from the following file:
Copyright © 2000–present ÚTIA, Institute of Information Theory and Automation of the Czech Academy of Sciences · Contacts · This site sets no cookies and uses no analytics.