469,607 Members | 2,154 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,607 developers. It's quick & easy.

C Library Wrapper in C++

Ian
Has anyone had any experience in writing wrappers for older C
libraries?
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,

Ian
mc****@yahoo.com
Jul 19 '05 #1
3 10079
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.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++ ftp://snurse-l.org/pub/acllc-c++/faq
Jul 19 '05 #2
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.
Jul 19 '05 #3
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.

Jul 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Mark McEahern | last post: by
1 post views Thread by Yaniv Oliver | last post: by
1 post views Thread by Steve Terepin | last post: by
5 posts views Thread by Octal | last post: by
1 post views Thread by dfj225 | last post: by
3 posts views Thread by jonlynch71 | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.