Click here to Skip to main content
16,011,685 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: multiple adapter loopback test using CSockets Pin
Tim Deveaux15-Mar-02 9:53
Tim Deveaux15-Mar-02 9:53 
GeneralRe: multiple adapter loopback test using CSockets Pin
gus15-Mar-02 10:26
gus15-Mar-02 10:26 
GeneralRe: multiple adapter loopback test using CSockets Pin
Tim Deveaux15-Mar-02 11:42
Tim Deveaux15-Mar-02 11:42 
GeneralRe: multiple adapter loopback test using CSockets Pin
gus19-Mar-02 4:15
gus19-Mar-02 4:15 
GeneralList control refresh issue Pin
Andrew Stampor15-Mar-02 8:48
Andrew Stampor15-Mar-02 8:48 
GeneralRe: List control refresh issue Pin
Shog915-Mar-02 8:59
sitebuilderShog915-Mar-02 8:59 
GeneralThread questions........... Pin
15-Mar-02 8:34
suss15-Mar-02 8:34 
GeneralRe: Thread questions........... Pin
Andres Manggini15-Mar-02 9:47
Andres Manggini15-Mar-02 9:47 
Hi,

1) The first parameter is the function which will represent the execution of your thread.. in other words, this function is going to be call after _beginthread(...)

Second one is the Stack Size, 0 most of the time.

<documentationcopypaste>
The operating system handles the allocation of the stack when either _beginthread or _beginthreadex is called; you do not need to pass the address of the thread stack to either of these functions. In addition, the stack_size argument can be 0, in which case the operating system uses the same value as the stack specified for the main thread.


Third: This can be a pointer to any type (struct, object, primitive type, etc..) you need. For example, if you need to pass several variables to the thread, probably the best way is to create a struct (or object) containing this variables and pass a pointer to this struct.



2) Search for Mutex or Semaphore, I think this is what you are looking for.. or maybe Sleep(...) if you want to suspend a thread for a given time.

3) You could, which does not mean is a good idea Smile | :) .
you probably don't want to create 1000 threads cause it produce resources overhead.


hope this helps.

Andres Manggini.
Buenos Aires - Argentina.
GeneralRe: Thread questions........... Pin
Nemanja Trifunovic15-Mar-02 10:19
Nemanja Trifunovic15-Mar-02 10:19 
GeneralRe: Thread questions........... Pin
Christopher Duncan15-Mar-02 11:36
Christopher Duncan15-Mar-02 11:36 
GeneralRe: Thread questions........... Pin
Tim Smith15-Mar-02 11:43
Tim Smith15-Mar-02 11:43 
GeneralRe: Thread questions........... Pin
Christopher Duncan15-Mar-02 15:23
Christopher Duncan15-Mar-02 15:23 
GeneralTHANK YOU ALL!!!!!!!!!!!!!!!!!!!!!!!!!!!! Pin
15-Mar-02 21:24
suss15-Mar-02 21:24 
GeneralDCOM with Visual C++ Pin
15-Mar-02 8:23
suss15-Mar-02 8:23 
GeneralRe: DCOM with Visual C++ Pin
Anand Amirineni15-Mar-02 14:54
Anand Amirineni15-Mar-02 14:54 
QuestionHow to stop this memory leak? Pin
Mark Tutt15-Mar-02 8:03
Mark Tutt15-Mar-02 8:03 
AnswerRe: How to stop this memory leak? Pin
Christian Graus15-Mar-02 10:27
protectorChristian Graus15-Mar-02 10:27 
GeneralRe: How to stop this memory leak? Pin
Mark Tutt15-Mar-02 10:32
Mark Tutt15-Mar-02 10:32 
GeneralStrings!!! Pin
15-Mar-02 7:49
suss15-Mar-02 7:49 
GeneralRe: Strings!!! Pin
Mike.NET15-Mar-02 8:00
Mike.NET15-Mar-02 8:00 
QuestionHow to make MFC apps use less RAM? Pin
Mike.NET15-Mar-02 7:44
Mike.NET15-Mar-02 7:44 
AnswerRe: How to make MFC apps use less RAM? Pin
Shog915-Mar-02 7:53
sitebuilderShog915-Mar-02 7:53 
GeneralVisual Studio .NET customization Pin
Todd Smith15-Mar-02 7:26
Todd Smith15-Mar-02 7:26 
GeneralCalling CListview in MDI application Pin
Jasmyn15-Mar-02 6:05
Jasmyn15-Mar-02 6:05 
Generalfurther details Pin
Jasmyn15-Mar-02 6:43
Jasmyn15-Mar-02 6:43 

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.