\"\" \"\" \"\"
Go up to Restrictions
Go forward to Standard Output
RISC-Linz logo

Standard Input

The memory buffers associated to the standard input stream are allocated in the data segment of a process. When an RT++ program is started, the standard input stream is bound to the initial process (process 0). Therefore a thread may read from the standard input stream only if it is executed on that process (but it is illegal if multiple threads simultaneously read from standard input).

Only the main thread (which is bound to the initial process) may read from standard input without special provision. All other threads must protect reading sequences as follows:  

rt_bind(0);
cin >> data;
rt_unbind();

Author: Wolfgang Schreiner
Last Modification: April 12, 1997