[comp.sys.encore] parallel threads library vs. C++ streams

walker@cs.uiuc.edu (William Walker) (02/01/91)

It appears that the ATT C++ streams package is incompatible
with the Encore Parallel Threads library. In particular, a
statement like

	cout << "hello, world";

causes a core dump. Can anyone confirm or deny my claim? Is
there a fix?


thanks,

Bill Walker       walker@cs.uiuc.edu       (217) 344-1312
 Department of Computer Science, University of Illinois
1304 West Springfield Avenue, Urbana, Illinois 61801-2987

P.A.Lee@newcastle.ac.uk (Pete Lee) (02/04/91)

In article <1991Jan31.202354.1895@cs.uiuc.edu>, walker@cs.uiuc.edu
(William Walker) writes:
>It appears that the ATT C++ streams package is incompatible
>with the Encore Parallel Threads library. In particular, a
>statement like
>
>	cout << "hello, world";
>
>causes a core dump. Can anyone confirm or deny my claim? Is
>there a fix?


One problem is that the Threads library replaces all of stdio with
thread-safe versions, but these cannot be used (safely) until THREADGo
has been executed - for instance, the Threads stdio may use thread
semaphores which will not work correctly until the Threads environment
is active. So, one problem is that it is not safe to do ANY I/O
operations before ThreadGo has been executed.

Note also, that you may not get correct behaviour with C++ constructors
which are automatically executed before ThreadGo has been. So, if you
build a C++ constructor which uses Thread-specific functions (e.g.
semaphores), and you have declared a global instance of that C++ class,
then the constructor will execute before the  Thread environment has
been set up ...