Click here to Skip to main content
15,909,566 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionBest Book for Visual C++ .net? Pin
Mutty6-Feb-06 9:22
Mutty6-Feb-06 9:22 
AnswerRe: Best Book for Visual C++ .net? Pin
Christian Graus6-Feb-06 11:43
protectorChristian Graus6-Feb-06 11:43 
AnswerRe: Best Book for Visual C++ .net? Pin
mark gooding7-Feb-06 4:34
mark gooding7-Feb-06 4:34 
QuestionCompile unicode strings into VC6 project, get pointer to strings in stringtable Pin
Andre xxxxxxx6-Feb-06 8:58
Andre xxxxxxx6-Feb-06 8:58 
AnswerRe: Compile unicode strings into VC6 project, get pointer to strings in stringtable Pin
PJ Arends6-Feb-06 11:07
professionalPJ Arends6-Feb-06 11:07 
GeneralRe: Compile unicode strings into VC6 project, get pointer to strings in stringtable Pin
Andre xxxxxxx6-Feb-06 11:41
Andre xxxxxxx6-Feb-06 11:41 
QuestionReading MiniDumps Pin
Richard Andrew x646-Feb-06 8:58
professionalRichard Andrew x646-Feb-06 8:58 
Questionmultithreading problem with boost Pin
Keith Vitali6-Feb-06 8:34
Keith Vitali6-Feb-06 8:34 
Hi everyone,

I am trying to use the boost multithreading library. I am having a
problem as the join() function for the thread never returns. I am using
a boolean variable to indicate when the thread should stop running.
Here is basically a stub of what I am doing:

<br />
//........................................<br />
bool m_RunThread = false;<br />
scoped_ptr<boost::thread> myThread;<br />
//.......................................<br />
<br />
void MyObject::StartThread()<br />
{<br />
   m_RunThread = true;<br />
   myThread.reset(new boost::thread(boost::bind<br />
  (&MyObject::MyThreadFunc, this)));<br />
}<br />
<br />
void MyObject::StopThread()<br />
{<br />
  m_RunThread = false;<br />
  myThread.join(); // this function never returns!<br />
<br />
  ... Never gets here....<br />
<br />
}<br />
<br />
void MyObject::MyThreadFunc()<br />
{<br />
  while (m_RunThread)<br />
  {<br />
   // do something<br />
  }<br />
}<br />


However, the join() function in StopThread never returns. I think that
using a variable to synchronize this is probably not a good idea. Any
thoughts and suggestions?

Cheers,

K
AnswerRe: multithreading problem with boost Pin
Stephen Hewitt6-Feb-06 12:39
Stephen Hewitt6-Feb-06 12:39 
GeneralRe: multithreading problem with boost Pin
Keith Vitali6-Feb-06 19:25
Keith Vitali6-Feb-06 19:25 
GeneralRe: multithreading problem with boost Pin
Stephen Hewitt6-Feb-06 19:29
Stephen Hewitt6-Feb-06 19:29 
QuestionVector question Pin
RobJones6-Feb-06 7:40
RobJones6-Feb-06 7:40 
AnswerRe: Vector question Pin
Maximilien6-Feb-06 7:52
Maximilien6-Feb-06 7:52 
AnswerRe: Vector question Pin
BlackDice6-Feb-06 9:00
BlackDice6-Feb-06 9:00 
AnswerRe: Vector question Pin
Stephen Hewitt6-Feb-06 11:48
Stephen Hewitt6-Feb-06 11:48 
GeneralRe: Vector question Pin
RobJones7-Feb-06 1:09
RobJones7-Feb-06 1:09 
QuestionUNICODE display Pin
transoft6-Feb-06 7:32
transoft6-Feb-06 7:32 
QuestionGauge controls for MFC Pin
Andre xxxxxxx6-Feb-06 7:18
Andre xxxxxxx6-Feb-06 7:18 
QuestionDownloading a File using Win32/C Pin
Mike Doner6-Feb-06 4:48
Mike Doner6-Feb-06 4:48 
AnswerRe: Downloading a File using Win32/C Pin
James R. Twine6-Feb-06 4:57
James R. Twine6-Feb-06 4:57 
AnswerRe: Downloading a File using Win32/C Pin
rrrado6-Feb-06 4:57
rrrado6-Feb-06 4:57 
QuestionModeless dialog clipped by it's parent dialog Pin
rrrado6-Feb-06 4:11
rrrado6-Feb-06 4:11 
AnswerRe: Modeless dialog clipped by it's parent dialog Pin
James R. Twine6-Feb-06 4:39
James R. Twine6-Feb-06 4:39 
GeneralRe: Modeless dialog clipped by it's parent dialog Pin
rrrado6-Feb-06 4:53
rrrado6-Feb-06 4:53 
AnswerRe: Modeless dialog clipped by it's parent dialog Pin
Maximilien6-Feb-06 7:05
Maximilien6-Feb-06 7:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.