All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sandro Dangui <sandro.dangui@gmail.com>
To: linux-c-programming@vger.kernel.org
Subject: Re: Multithreading with C++
Date: Thu, 7 Apr 2005 17:26:05 -0300	[thread overview]
Message-ID: <fde20208050407132613484e07@mail.gmail.com> (raw)
In-Reply-To: <fde202080504071322520de47@mail.gmail.com>

How many threads are you trying to create? I mean, using your class CThread...
I see only a problem when trying to create more than one thread, due
to the "static CThread*  m_pThis". This attribute should not be shared
between all threads you create. I think you want to have a
relationship 1 to 1, for each instance of CThead class you want to
have one actual running thread handling with.
  
Sandro.
 
 ----------------------------------------------------------------------------------------
  
> On Apr 7, 2005 4:01 PM, Darío Mariani <mariani.dario@gmail.com> wrote: 
> > There are several libraries that implement multithreading in C++:
> > 
> > * http://www.boost.org
> > * http://www.melikyan.com/ptypes/
> > * http://www.cs.wustl.edu/~schmidt/ACE.html
> > 
> > You can use one of them and avoid the trouble of creating your own
> > library, or look there to see how they did it ;-).
> > 
> >           Darío
> > 
> > On Apr 7, 2005 3:52 PM, Huber, George K RDECOM CERDEC STCD SRI
> > <George.K.Huber@us.army.mil> wrote:
> > > Eric wrote:
> > >
> > > Did you compile with -lpthread and -D_REENTRANT? If I remeber correctly, this
> > > is something I had alot of trouble with when I started thread programming.
> > > Similiar error and everything. Compiled but the library calls weren't
> > > working. Make sure to include <pthread.h> too  ;)
> > >
> > > yes included <pthread.h>, defined -D_REENTRANT and linked with -lpthread
> > >
> > > I have written multi-threaded code in C, this is the first time that I have attempted
> > > to encapsulate a thread in a C++ object.  Must be missing something. :-(
> > >
> > > George
> > > -
> > > To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
> > > the body of a message to majordomo@vger.kernel.org
> > > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > >
> > 
> > --
> > That is not dead which can eternal lie,
> > and with strange aeons, even death may die.
> > -
> > To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> > 
> 
>
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2005-04-07 20:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-07 18:52 Multithreading with C++ Huber, George K RDECOM CERDEC STCD SRI
2005-04-07 19:01 ` Darío Mariani
     [not found]   ` <fde202080504071322520de47@mail.gmail.com>
2005-04-07 20:26     ` Sandro Dangui [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-04-08  6:47 Colovic (ext_evosoft) Aleksandar
2005-04-07 17:02 Huber, George K RDECOM CERDEC STCD SRI
2005-04-07 16:36 ` Eric Bambach
2005-04-08  2:01 ` Ron Michael Khu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fde20208050407132613484e07@mail.gmail.com \
    --to=sandro.dangui@gmail.com \
    --cc=linux-c-programming@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.