Click here to Skip to main content
15,887,267 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: About Thread argument Pin
manish.patel13-Dec-07 22:46
manish.patel13-Dec-07 22:46 
GeneralRe: About Thread argument Pin
CPallini13-Dec-07 23:32
mveCPallini13-Dec-07 23:32 
GeneralRe: About Thread argument Pin
manish.patel13-Dec-07 23:53
manish.patel13-Dec-07 23:53 
GeneralRe: About Thread argument [modified] Pin
CPallini14-Dec-07 0:12
mveCPallini14-Dec-07 0:12 
GeneralRe: About Thread argument Pin
Cedric Moonen14-Dec-07 0:53
Cedric Moonen14-Dec-07 0:53 
GeneralRe: About Thread argument Pin
CPallini14-Dec-07 1:09
mveCPallini14-Dec-07 1:09 
GeneralRe: About Thread argument Pin
Cedric Moonen14-Dec-07 1:15
Cedric Moonen14-Dec-07 1:15 
GeneralRe: About Thread argument Pin
CPallini14-Dec-07 2:43
mveCPallini14-Dec-07 2:43 
Good point, indeed. Smile | :)


Anyway, there's a caveat: if you use the scenario that breaks my modified ugly code

Cedric Moonen wrote:
That's not very usefull: it is kind of a snake that bites its own tail. You pass in a structure which contains a pointer to the class which itself contains the structure. So, what's the point ? So, you still can't pass different 'x' values to different threads (here again, potential race condition). Because I suppose if the OP wanted to do something like that was because he plans to start several threads and pass some specific information to each of them along the this pointer.


it breaks your code too (unless he starts one thread per class instance). Big Grin | :-D


BTW I think he wants to start a single thread hence your solution is good (I think also he probably needs read-only access to local variables).

Smile | :)
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.


GeneralRe: About Thread argument Pin
Cedric Moonen14-Dec-07 1:12
Cedric Moonen14-Dec-07 1:12 
GeneralRe: About Thread argument Pin
CPallini14-Dec-07 2:50
mveCPallini14-Dec-07 2:50 
JokeRe: About Thread argument Pin
Cedric Moonen14-Dec-07 4:06
Cedric Moonen14-Dec-07 4:06 
GeneralRe: About Thread argument Pin
Member 75496014-Dec-07 9:08
Member 75496014-Dec-07 9:08 
Generalcheck if service is available - Vista Pin
Lord_Draconis13-Dec-07 22:17
Lord_Draconis13-Dec-07 22:17 
GeneralRe: check if service is available - Vista Pin
JudyL_MD14-Dec-07 2:24
JudyL_MD14-Dec-07 2:24 
GeneralRe: check if service is available - Vista Pin
Lord_Draconis14-Dec-07 3:41
Lord_Draconis14-Dec-07 3:41 
GeneralRe: check if service is available - Vista Pin
JudyL_MD14-Dec-07 3:53
JudyL_MD14-Dec-07 3:53 
QuestionPrint Preview in Dialog Pin
Shivarudrayya H13-Dec-07 21:57
Shivarudrayya H13-Dec-07 21:57 
GeneralRe: Print Preview in Dialog Pin
Nelek13-Dec-07 22:38
protectorNelek13-Dec-07 22:38 
GeneralRe: Print Preview in Dialog Pin
Shivarudrayya H13-Dec-07 22:56
Shivarudrayya H13-Dec-07 22:56 
GeneralRe: Print Preview in Dialog Pin
Nelek13-Dec-07 23:57
protectorNelek13-Dec-07 23:57 
GeneralRe: Print Preview in Dialog Pin
santhoshv8413-Dec-07 22:39
santhoshv8413-Dec-07 22:39 
Generalc++ and ... Pin
mostafa_h13-Dec-07 21:49
mostafa_h13-Dec-07 21:49 
GeneralRe: c++ and ... Pin
Nelek13-Dec-07 22:27
protectorNelek13-Dec-07 22:27 
GeneralRe: c++ and ... Pin
mostafa_h13-Dec-07 23:15
mostafa_h13-Dec-07 23:15 
GeneralRe: c++ and ... Pin
toxcct13-Dec-07 23:40
toxcct13-Dec-07 23:40 

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.