Click here to Skip to main content
15,896,557 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralFile Preview !! Pin
Mash25-Nov-02 8:35
Mash25-Nov-02 8:35 
GeneralSocket TIME_WAIT questions.. Pin
RobJones25-Nov-02 8:32
RobJones25-Nov-02 8:32 
GeneralRe: Socket TIME_WAIT questions.. Pin
valikac25-Nov-02 8:58
valikac25-Nov-02 8:58 
GeneralRe: Socket TIME_WAIT questions.. Pin
RobJones25-Nov-02 9:59
RobJones25-Nov-02 9:59 
GeneralRe: Socket TIME_WAIT questions.. Pin
valikac25-Nov-02 10:57
valikac25-Nov-02 10:57 
GeneralRe: Socket TIME_WAIT questions.. Pin
RobJones25-Nov-02 11:03
RobJones25-Nov-02 11:03 
General,Thread and Mutex Pin
Anonymous25-Nov-02 7:45
Anonymous25-Nov-02 7:45 
GeneralRe: ,Thread and Mutex Pin
Scott H. Settlemier25-Nov-02 8:10
Scott H. Settlemier25-Nov-02 8:10 
First, if you're going to use a synhcronization object to
protect a flag, use the synchronization object as the flag.
i.e. Use an Event whose state is checked as a condition to exit
the thread. (better yet use two events.. one to signal work to
be done, the other to exit. wait (WaitForMultipleObjects) on both
and then react appropriately.. that way your work thread won't
waste cycles running through loops pointlessly.)

Second, yes. Even access to resources should be protected (generally)
since you want to ensure that the resource is not being modified while
you are reading it. (or whatever)

That said, some types of resources (small register-sized variables
generally) can be read/written without the need of a protecting
synchronization object. Check out the Interlocked_______ functions
in win32.
GeneralRe: ,Thread and Mutex Pin
Ruca26-Nov-02 1:11
Ruca26-Nov-02 1:11 
GeneralRe: ,Thread and Mutex Pin
Scott H. Settlemier28-Nov-02 16:14
Scott H. Settlemier28-Nov-02 16:14 
General,Thread and Mutex Pin
Anonymous25-Nov-02 7:34
Anonymous25-Nov-02 7:34 
GeneralAnimation Control Pin
Brigg Thorp25-Nov-02 7:28
Brigg Thorp25-Nov-02 7:28 
GeneralRe: Animation Control Pin
Scott H. Settlemier25-Nov-02 10:16
Scott H. Settlemier25-Nov-02 10:16 
GeneralBasic MFC question Pin
will138325-Nov-02 5:54
will138325-Nov-02 5:54 
GeneralRe: Basic MFC question Pin
Rob Caldecott25-Nov-02 5:58
Rob Caldecott25-Nov-02 5:58 
GeneralRe: Basic MFC question Pin
Roman Fadeyev25-Nov-02 6:04
Roman Fadeyev25-Nov-02 6:04 
GeneralRe: Basic MFC question Pin
Stephane Rodriguez.25-Nov-02 6:39
Stephane Rodriguez.25-Nov-02 6:39 
GeneralRe: Basic MFC question Pin
Jeff Patterson26-Nov-02 3:26
Jeff Patterson26-Nov-02 3:26 
GeneralCFileDialog problem under win 98 Pin
lbc25-Nov-02 5:50
lbc25-Nov-02 5:50 
GeneralRe: CFileDialog problem under win 98 Pin
Rob Caldecott25-Nov-02 5:57
Rob Caldecott25-Nov-02 5:57 
GeneralRe: CFileDialog problem under win 98 Pin
lbc25-Nov-02 22:06
lbc25-Nov-02 22:06 
GeneralMDI Splitter problems Pin
Bjornarsen25-Nov-02 5:43
Bjornarsen25-Nov-02 5:43 
GeneralRe: MDI Splitter problems Pin
dima_t25-Nov-02 18:02
dima_t25-Nov-02 18:02 
GeneralRe: Sockets and Threads Pin
georgiek5025-Nov-02 5:34
georgiek5025-Nov-02 5:34 
GeneralProblem with CDialogBar e CTreeCtrl Pin
Anthiny B.25-Nov-02 5:06
sussAnthiny B.25-Nov-02 5:06 

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.