Alan Gifford wrote:
Jack Klein <ja*******@spamcop.net> wrote in message news:<cl********************************@4ax.com>. ..
On 16 Oct 2003 14:12:08 -0700, mc****@yahoo.com (Ian) wrote in
comp.lang.c++:
Has anyone had any experience in writing wrappers for older C
libraries?
Yes, many people have.
What I'm looking at doing is creating a wrapper C++ object as a front
end to an older C library, also the library is not thread-safe, which
I have to somehow make safe for multi-threading (CRITICAL_SECTIONS
maybe) for integration into a server.
Thanks,
The C++ language does not define or support multiple threads of
execution, so that aspect of your question is off-topic here. You
need to ask in a Windows programming group.
So you mean you can't use multithreading with C++ programs in Linux?
A co-worker was telling me about using C++ classes to handle locks and
some other stuff in multithreading (I don't know how to do it yet)
that made it really easy, but I think he was talking about Windows NT
programming.
No, he means that it's not built into the Standard C++ language.
Wrappers and such for multithreading APIs are OS and/or MT
implementation specific, and are not discussed in the standard.
That said, I have several classes that wrap up some Win32 multithreading
primitives. They are implemented in Standard C++, but they are not part
of Standard C++.
C++ is a great language for this sort of wrapper, because it helps to
avoid problems such as mutexes and critical sections accidentally left
locked. But because they're OS specific, they're not in the standard.