Click here to Skip to main content
15,899,596 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: A couple of problems - cin.get - (Beginner) Pin
haitch7930-Apr-06 9:41
haitch7930-Apr-06 9:41 
GeneralRe: A couple of problems - cin.get - (Beginner) Pin
Maxwell Chen30-Apr-06 18:15
Maxwell Chen30-Apr-06 18:15 
GeneralRe: A couple of problems - cin.get - (Beginner) Pin
haitch7930-Apr-06 23:52
haitch7930-Apr-06 23:52 
GeneralRe: A couple of problems - cin.get - (Beginner) Pin
Maxwell Chen1-May-06 0:33
Maxwell Chen1-May-06 0:33 
Question---how to lock two mutexes simultaneously in atomic mode? Pin
dragooooon lee30-Apr-06 3:26
dragooooon lee30-Apr-06 3:26 
AnswerRe: ---how to lock two mutexes simultaneously in atomic mode? Pin
Ryan Binns30-Apr-06 18:32
Ryan Binns30-Apr-06 18:32 
GeneralRe: ---how to lock two mutexes simultaneously in atomic mode? Pin
Rilhas1-May-06 1:33
Rilhas1-May-06 1:33 
GeneralRe: ---how to lock two mutexes simultaneously in atomic mode? Pin
dragooooon lee2-May-06 6:48
dragooooon lee2-May-06 6:48 
hi ,Ryan and Rilhas

the context is producer/consumer

thread1
----------------------------------------------
p(empty)
mutexRW.lock()
produce(item)
mutexRW.unlock()
v(full)
-----------------------------------------------------
thread2
----------------------------------------------
p(full)
mutexRW.lock()
comsume(item)
mutexRW.unlock()
v(empty)
-----------------------------------------------------

I need to stop thread1 and thread2 sinultaneously in thread3 to avoid deadlock at p(empty) in thread1 for buffer is full or deadlock at p(full) in thread2 for buffer is empty.
and I can't use a third mutex to achieve that because a third mutex would be unefficient for producer/consumer. so give me some clues to solve this problem please. thanks
Confused | :confused:


Vincent

-- modified at 12:48 Tuesday 2nd May, 2006
GeneralRe: ---how to lock two mutexes simultaneously in atomic mode? Pin
Rilhas2-May-06 10:08
Rilhas2-May-06 10:08 
QuestionVC++( 2-d,3-d graphics problem) Pin
RavindraKumar30-Apr-06 2:27
RavindraKumar30-Apr-06 2:27 
Questionhow can I get the pointer of the scrollbar on the listctrl? Pin
yingkou30-Apr-06 0:41
yingkou30-Apr-06 0:41 
AnswerRe: how can I get the pointer of the scrollbar on the listctrl? Pin
YaronNir30-Apr-06 0:55
YaronNir30-Apr-06 0:55 
GeneralRe: how can I get the pointer of the scrollbar on the listctrl? Pin
yingkou30-Apr-06 1:06
yingkou30-Apr-06 1:06 
GeneralRe: how can I get the pointer of the scrollbar on the listctrl? Pin
Justin Tay30-Apr-06 1:16
Justin Tay30-Apr-06 1:16 
GeneralRe: how can I get the pointer of the scrollbar on the listctrl? Pin
yingkou5-May-06 18:45
yingkou5-May-06 18:45 
QuestionINI Files Under VC++ 2005 ? Pin
Fritzables29-Apr-06 20:42
Fritzables29-Apr-06 20:42 
AnswerRe: INI Files Under VC++ 2005 ? Pin
YaronNir29-Apr-06 20:55
YaronNir29-Apr-06 20:55 
AnswerRe: INI Files Under VC++ 2005 ? Pin
John R. Shaw29-Apr-06 21:09
John R. Shaw29-Apr-06 21:09 
AnswerRe: INI Files Under VC++ 2005 ? Pin
Trollslayer30-Apr-06 0:10
mentorTrollslayer30-Apr-06 0:10 
AnswerRe: INI Files Under VC++ 2005 ? Pin
Kevin McFarlane30-Apr-06 4:15
Kevin McFarlane30-Apr-06 4:15 
GeneralRe: INI Files Under VC++ 2005 ? Pin
Maxwell Chen30-Apr-06 18:54
Maxwell Chen30-Apr-06 18:54 
GeneralRe: INI Files Under VC++ 2005 ? Pin
Kevin McFarlane1-May-06 1:40
Kevin McFarlane1-May-06 1:40 
GeneralRe: INI Files Under VC++ 2005 ? Pin
Maxwell Chen1-May-06 4:00
Maxwell Chen1-May-06 4:00 
AnswerRe: INI Files Under VC++ 2005 ? Pin
Fritzables30-Apr-06 15:03
Fritzables30-Apr-06 15:03 
GeneralRe: INI Files Under VC++ 2005 ? Pin
Gordon Brandly1-May-06 7:50
Gordon Brandly1-May-06 7:50 

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.