Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > C Library Wrapper in C++

Reply
Thread Tools

C Library Wrapper in C++

 
 
Ian
Guest
Posts: n/a
 
      10-16-2003
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
http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
 
 
 
Jack Klein
Guest
Posts: n/a
 
      10-17-2003
On 16 Oct 2003 14:12:08 -0700, (E-Mail Removed) (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
 
Reply With Quote
 
 
 
 
Alan Gifford
Guest
Posts: n/a
 
      10-18-2003
Jack Klein <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>. ..
> On 16 Oct 2003 14:12:08 -0700, (E-Mail Removed) (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.
 
Reply With Quote
 
red floyd
Guest
Posts: n/a
 
      10-18-2003
Alan Gifford wrote:
> Jack Klein <(E-Mail Removed)> wrote in message news:<(E-Mail Removed)>. ..
>
>>On 16 Oct 2003 14:12:08 -0700, (E-Mail Removed) (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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
is the C library a wrapper for windows API? mastermagrath C Programming 29 09-04-2006 09:58 PM
ANN: PyGMP 0.9 (Python GNU Multiple Precision Library wrapper) Heiko Wundram Python 1 06-03-2004 04:16 AM
Add PayFlow Pro wrapper to standard library? Mark McEahern Python 1 02-02-2004 02:42 PM
Wrapper to speex and ffmpeg library maxwell hammer Python 0 01-17-2004 06:31 AM
[Dream] A meta-wrapper module to interface any C dynamic library Francesco Bochicchio Python 6 07-04-2003 05:39 PM



Advertisments