bazillion stepstones with multithreading...

L

Lars Uffmann

<- about to have a major crisis here.

All I wanted is to create a little tool with a GUI. Now I see problems
related to thread programming arising everywhere. If I use the GUI to
set a flag as a stop condition checked by my thread, but reset the flag
when the user wants to restart the thread, then technically I could run
into a problem with the original thread never noticing it was supposed
to end in the first place, and then I have 2 threads with the same
routine running at the same time, creating lots and lots of unwanted
race conditions.

Does anyone have a link to a good writeup on thread programming
philosophy? How to set up GUI applications and avoid race conditions,
for example upon writing/reading properties of wxWidgets components? Do
I have to use a mutex object for every single control element that is
manipulated by more than just 1 thread?

Best Regards,

Lars
 
A

AnonMail2005

<- about to have a major crisis here.

All I wanted is to create a little tool with a GUI. Now I see problems
related to thread programming arising everywhere. If I use the GUI to
set a flag as a stop condition checked by my thread, but reset the flag
when the user wants to restart the thread, then technically I could run
into a problem with the original thread never noticing it was supposed
to end in the first place, and then I have 2 threads with the same
routine running at the same time, creating lots and lots of unwanted
race conditions.

Does anyone have a link to a good writeup on thread programming
philosophy? How to set up GUI applications and avoid race conditions,
for example upon writing/reading properties of wxWidgets components? Do
I have to use a mutex object for every single control element that is
manipulated by more than just 1 thread?

Best Regards,

    Lars

Read the Butenhof book. Very good book. It uses pthreads but the
threading concepts it covers are applicable to any threading
library. After you have those concepts down, you can design your
app.

HTH
 
L

Lars Uffmann

Read the Butenhof book. Very good book. It uses pthreads but the
threading concepts it covers are applicable to any threading
library. After you have those concepts down, you can design your
app.

Thank you!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top