Click here to Skip to main content
15,892,298 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: to show an color filled object on the top of everything Pin
Albert Holguin12-Dec-13 4:19
professionalAlbert Holguin12-Dec-13 4:19 
Questionstd::swap Corruption [Answered] Pin
Skippums11-Dec-13 7:26
Skippums11-Dec-13 7:26 
AnswerRe: std::swap Corruption Pin
Skippums11-Dec-13 8:35
Skippums11-Dec-13 8:35 
QuestionQuestion About Threads Pin
AmbiguousName11-Dec-13 5:55
AmbiguousName11-Dec-13 5:55 
AnswerRe: Question About Threads Pin
jschell11-Dec-13 9:03
jschell11-Dec-13 9:03 
AnswerRe: Question About Threads Pin
Chris Losinger11-Dec-13 10:37
professionalChris Losinger11-Dec-13 10:37 
GeneralRe: Question About Threads Pin
Richard Andrew x6411-Dec-13 13:56
professionalRichard Andrew x6411-Dec-13 13:56 
AnswerRe: Question About Threads Pin
Albert Holguin12-Dec-13 4:25
professionalAlbert Holguin12-Dec-13 4:25 
AmbiguousName wrote:
1 - By default, every thread has one megabyte of stack space. Therefore, you can create at most 2,048 threads ( copied From MSDN ). How do I maximize or minimize stack size and how do I calculate max number of threads for this stack size.

Don't think it's beneficial to even be considering changing the maximum number of threads. If you have to be concerned about that, then your process design is probably not well thought out.
AmbiguousName wrote:
2 - Lets say I create 10 threads using CreateThread() and each of them returns a valid handle. What is the best technique to store all these handles and then use them to close/terminate those threads.

You can store the handles any way you want (simple array or any container). Look at the WaitForSingleObject() (and corresponding WaitForMultipleObjects()) call for tracking when a thread has finished his task. You can also use signaling... such as events for tracking when the threads are finishing up doing their work.

Additionally, there's a concept for managing multiple worker threads without the overhead of constantly restarting them called a "thread pool". In certain cases, that can be beneficial since the overhead of starting threads can be rather significant.
QuestionRe: Question About Threads Pin
AmbiguousName12-Dec-13 4:58
AmbiguousName12-Dec-13 4:58 
QuestionAlways write to top of file Pin
Grahamfff11-Dec-13 1:16
Grahamfff11-Dec-13 1:16 
AnswerRe: Always write to top of file Pin
Richard MacCutchan11-Dec-13 1:53
mveRichard MacCutchan11-Dec-13 1:53 
GeneralRe: Always write to top of file Pin
Grahamfff11-Dec-13 2:33
Grahamfff11-Dec-13 2:33 
GeneralRe: Always write to top of file Pin
Richard MacCutchan11-Dec-13 2:38
mveRichard MacCutchan11-Dec-13 2:38 
GeneralRe: Always write to top of file Pin
Grahamfff11-Dec-13 4:04
Grahamfff11-Dec-13 4:04 
GeneralRe: Always write to top of file Pin
Richard MacCutchan11-Dec-13 4:57
mveRichard MacCutchan11-Dec-13 4:57 
GeneralRe: Always write to top of file Pin
enhzflep11-Dec-13 4:58
enhzflep11-Dec-13 4:58 
AnswerRe: Always write to top of file Pin
Eugen Podsypalnikov11-Dec-13 2:26
Eugen Podsypalnikov11-Dec-13 2:26 
QuestionRe: Always write to top of file Pin
David Crow11-Dec-13 5:15
David Crow11-Dec-13 5:15 
AnswerRe: Always write to top of file Pin
Grahamfff11-Dec-13 5:22
Grahamfff11-Dec-13 5:22 
GeneralRe: Always write to top of file Pin
Stefan_Lang15-Dec-13 23:23
Stefan_Lang15-Dec-13 23:23 
AnswerRe: Always write to top of file Pin
Alan Balkany11-Dec-13 5:27
Alan Balkany11-Dec-13 5:27 
Questionapp for windows 8.1 Pin
Member 1045927510-Dec-13 22:32
Member 1045927510-Dec-13 22:32 
AnswerRe: app for windows 8.1 Pin
Richard MacCutchan11-Dec-13 0:23
mveRichard MacCutchan11-Dec-13 0:23 
AnswerRe: app for windows 8.1 Pin
Erudite_Eric11-Dec-13 1:57
Erudite_Eric11-Dec-13 1:57 
QuestionGet rid of STL warnings Pin
_Flaviu10-Dec-13 21:58
_Flaviu10-Dec-13 21:58 

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.