Click here to Skip to main content
15,908,776 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Memory Problem on CPtrArray Pin
Blake Miller28-Mar-05 4:05
Blake Miller28-Mar-05 4:05 
QuestionHow to write a Winsock application that captures localhost process packets Pin
covansys200024-Mar-05 23:13
covansys200024-Mar-05 23:13 
General.:: Bluetooth programming ::. (i need help) Pin
wise_8224-Mar-05 23:04
wise_8224-Mar-05 23:04 
GeneralRe: .:: Bluetooth programming ::. (i need help) Pin
toxcct25-Mar-05 1:09
toxcct25-Mar-05 1:09 
GeneralRe: .:: Bluetooth programming ::. (i need help) Pin
wise_8225-Mar-05 11:25
wise_8225-Mar-05 11:25 
GeneralRe: .:: Bluetooth programming ::. (i need help) Pin
toxcct26-Mar-05 4:36
toxcct26-Mar-05 4:36 
QuestionHow to avoid using multiple threads in winsock programming? Pin
johtib24-Mar-05 22:53
johtib24-Mar-05 22:53 
AnswerRe: How to avoid using multiple threads in winsock programming? Pin
geo_m25-Mar-05 2:26
geo_m25-Mar-05 2:26 
I agree, that in the described level of functionality are three threads an unnecessary overhead.

Just firing from the head - you can join at least threads T2 and T3 to one.
then it would be something like:
threadT23
{
  loopCounter = 0;
  loop
   {
     Sleep for 30 seconds
     Send broadcast
     if( loopCounter == 4 ) // 4 * 30 sec = 2 min
     {
         do the T3 work
     }
     loopCounter++;
     if( loopCounter > 4 ) loopCounter = 0;
   }
}


similary you can join the T1 with T23, only thing you need is some sort of nonblocking listen.

This is just an idea from the scratch, so not necessarily the best one, but at least something... Smile | :)
AnswerRe: How to avoid using multiple threads in winsock programming? Pin
RobJones25-Mar-05 6:30
RobJones25-Mar-05 6:30 
GeneralRe: How to avoid using multiple threads in winsock programming? Pin
johtib25-Mar-05 8:10
johtib25-Mar-05 8:10 
GeneralRe: How to avoid using multiple threads in winsock programming? Pin
Blake Miller28-Mar-05 4:08
Blake Miller28-Mar-05 4:08 
GeneralRe: How to avoid using multiple threads in winsock programming? Pin
johtib4-Apr-05 23:23
johtib4-Apr-05 23:23 
GeneralRe: How to avoid using multiple threads in winsock programming? Pin
Blake Miller6-Apr-05 5:09
Blake Miller6-Apr-05 5:09 
GeneralRe: How to avoid using multiple threads in winsock programming? Pin
johtib8-Apr-05 21:46
johtib8-Apr-05 21:46 
GeneralRe: How to avoid using multiple threads in winsock programming? Pin
Blake Miller11-Apr-05 5:20
Blake Miller11-Apr-05 5:20 
GeneralRe: How to avoid using multiple threads in winsock programming? Pin
johtib11-Apr-05 6:39
johtib11-Apr-05 6:39 
GeneralRe: How to avoid using multiple threads in winsock programming? Pin
Blake Miller11-Apr-05 12:29
Blake Miller11-Apr-05 12:29 
Questiondraw on ToolBar Button??? Pin
Anything.J24-Mar-05 22:01
Anything.J24-Mar-05 22:01 
QuestionHow many of you use _tcsinc ? Pin
Chintoo72324-Mar-05 20:55
Chintoo72324-Mar-05 20:55 
AnswerRe: How many of you use _tcsinc ? Pin
toxcct24-Mar-05 21:17
toxcct24-Mar-05 21:17 
GeneralRe: How many of you use _tcsinc ? Pin
Chintoo72324-Mar-05 22:07
Chintoo72324-Mar-05 22:07 
GeneralRe: How many of you use _tcsinc ? Pin
toxcct24-Mar-05 22:16
toxcct24-Mar-05 22:16 
AnswerRe: How many of you use _tcsinc ? Pin
PJ Arends24-Mar-05 22:08
professionalPJ Arends24-Mar-05 22:08 
GeneralRe: How many of you use _tcsinc ? Pin
Chintoo72325-Mar-05 1:05
Chintoo72325-Mar-05 1:05 
AnswerRe: How many of you use _tcsinc ? Pin
Chintoo72325-Mar-05 1:20
Chintoo72325-Mar-05 1:20 

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.