Click here to Skip to main content
15,915,713 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CCriticalSection question Pin
jmkhael5-May-04 2:43
jmkhael5-May-04 2:43 
GeneralRe: CCriticalSection question Pin
Alexander M.,5-May-04 4:45
Alexander M.,5-May-04 4:45 
GeneralRe: CCriticalSection question Pin
jmkhael5-May-04 4:47
jmkhael5-May-04 4:47 
GeneralRe: CCriticalSection question Pin
Alexander M.,5-May-04 4:48
Alexander M.,5-May-04 4:48 
GeneralRe: CCriticalSection question Pin
jmkhael5-May-04 4:49
jmkhael5-May-04 4:49 
GeneralRe: CCriticalSection question Pin
Alexander M.,5-May-04 4:53
Alexander M.,5-May-04 4:53 
GeneralRe: CCriticalSection question Pin
jmkhael5-May-04 4:54
jmkhael5-May-04 4:54 
GeneralRe: CCriticalSection question Pin
oferbgu5-May-04 4:59
oferbgu5-May-04 4:59 
Thanks for everyone response..
I need to use criticalsection due to the following facts:
1. Mutex is signaled off after a task that took ownership ends, and I need the status to be on.
2. events are not good since i have several tasks waiting on the Critical Section , and the order of arrival is important

what I thought about doing is to create a temp thread that locks the critical section, while the main thread is waiting for several events (the temp thread receives reference to the critical section, as well as a reference to an additional event)
now, if the temp thread actually took control of the critical section, it ends normaly, and the wait command in the main thread is ended due to that.
The really interesting situation is when the temp thread is trying to lock the critical section, and the critical section is already locked - so the temp thread is waiting.
Now, I'm receiving another event, that is causing the wait on the main thread to finish - but the temp thread is still up and running.

I've found out that if, after we are exiting the wait, I'm performing Unlock to the critical section, the attempted lock is finished.
Am I correct?


He didn't fall?
Inconceivable!!!
GeneralRe: CCriticalSection question Pin
Paul Ranson5-May-04 8:39
Paul Ranson5-May-04 8:39 
GeneralRe: CCriticalSection question Pin
Paul Ranson5-May-04 8:40
Paul Ranson5-May-04 8:40 
Generalaccess other system resources on network by its IP Pin
Zeeshan Bilal5-May-04 1:26
Zeeshan Bilal5-May-04 1:26 
GeneralRe: access other system resources on network by its IP Pin
toxcct5-May-04 1:37
toxcct5-May-04 1:37 
GeneralRe: access other system resources on network by its IP Pin
David Crow5-May-04 2:25
David Crow5-May-04 2:25 
GeneralPublic Variable access : New problem Pin
Krugger4045-May-04 1:23
Krugger4045-May-04 1:23 
GeneralRe: Public Variable access : New problem Pin
jmkhael5-May-04 1:34
jmkhael5-May-04 1:34 
GeneralRe: Public Variable access : New problem Pin
Michael P Butler5-May-04 1:38
Michael P Butler5-May-04 1:38 
GeneralRe: Public Variable access : New problem Pin
nguyenvhn5-May-04 1:40
nguyenvhn5-May-04 1:40 
GeneralRe: Public Variable access : New problem Pin
User 66585-May-04 2:31
User 66585-May-04 2:31 
GeneralCreateFile returns error 32 Pin
BeeTel5-May-04 1:12
BeeTel5-May-04 1:12 
GeneralRe: CreateFile returns error 32 Pin
David Crow5-May-04 2:32
David Crow5-May-04 2:32 
GeneralRe: CreateFile returns error 32 Pin
Alexander M.,5-May-04 4:55
Alexander M.,5-May-04 4:55 
GeneralData Verification problem Pin
IceBerG715-May-04 0:55
IceBerG715-May-04 0:55 
GeneralRe: Data Verification problem Pin
Michael P Butler5-May-04 1:44
Michael P Butler5-May-04 1:44 
GeneralRe: Data Verification problem Pin
hasansheik5-May-04 2:32
hasansheik5-May-04 2:32 
GeneralBrowse For Folder settings - help required Pin
nihal_kashinath5-May-04 0:43
nihal_kashinath5-May-04 0: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.