On Mon, Oct 09, 2000, flobro wrote:
> If the pthreads is built with syscall-soft, how do you use any of the
> iostreams::write... functions? The templates will convert any "write" to
> "__pthread_write" (operator <<) because of the macros in pthreads.h,
> causing a compile error (no matching function to call to
> 'ostream::__pthread_write'.
> Any ideas will be appreciated.
Oh, iostreams::write is C++, Pth is an C only API. And the use of Pth
inside C++ is considered "not intended". It might work if there is no
implementation conflict between the C++ compilers exception handling and
Pth's machine context plus if you don't use the syscall stuff. But in
general Pth is not intended to work with C++, so it certainly lacks a
few compatibility things like workarounds for those macros. If someone
has ideas, suggestions or even patches to make Pth work _really
seamlessly_ also with C++, let me know.
Otherwise I recommend you to use one of the C++ wrapper libraries
like CommonC++ (http://cplusplus.sourceforge.net/) or Threads
(http://sourceforge.net/projects/threads). They can be built against
Pth's Pthread API but they provide real C++ APIs instead. This is the
recommended way of using Pth with C++.
Yours,
Ralf S. Engelschall
[EMAIL PROTECTED]
www.engelschall.com
______________________________________________________________________
GNU Portable Threads (Pth) http://www.gnu.org/software/pth/
User Support Mailing List [EMAIL PROTECTED]
Automated List Manager (Majordomo) [EMAIL PROTECTED]