Click here to Skip to main content
15,905,068 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralIDE Bug/Problem Pin
sweep12327-Jul-04 6:14
sweep12327-Jul-04 6:14 
GeneralRe: IDE Bug/Problem Pin
David Crow27-Jul-04 8:09
David Crow27-Jul-04 8:09 
GeneralRe: IDE Bug/Problem Pin
sweep12327-Jul-04 22:02
sweep12327-Jul-04 22:02 
GeneralRe: IDE Bug/Problem Pin
David Crow28-Jul-04 3:58
David Crow28-Jul-04 3:58 
GeneralRe: IDE Bug/Problem Pin
sweep12328-Jul-04 6:29
sweep12328-Jul-04 6:29 
Generalcpu performance Pin
hph27-Jul-04 4:59
hph27-Jul-04 4:59 
GeneralRe: cpu performance Pin
David Crow27-Jul-04 8:05
David Crow27-Jul-04 8:05 
GeneralRe: cpu performance Pin
bikram singh27-Jul-04 8:06
bikram singh27-Jul-04 8:06 
GeneralNT: Use Performance Counters Pin
bikram singh27-Jul-04 8:09
bikram singh27-Jul-04 8:09 
QuestionUpper limit of stack size increase..?? Pin
Shiva Prasad27-Jul-04 4:44
Shiva Prasad27-Jul-04 4:44 
GeneralKeeping Window On Top Pin
KingTermite27-Jul-04 3:04
KingTermite27-Jul-04 3:04 
GeneralRe: Keeping Window On Top Pin
David Crow27-Jul-04 4:01
David Crow27-Jul-04 4:01 
GeneralRe: Keeping Window On Top Pin
KingTermite27-Jul-04 8:34
KingTermite27-Jul-04 8:34 
GeneralRe: Keeping Window On Top Pin
David Crow27-Jul-04 8:47
David Crow27-Jul-04 8:47 
GeneralRe: Keeping Window On Top Pin
KingTermite27-Jul-04 10:52
KingTermite27-Jul-04 10:52 
GeneralRe: Keeping Window On Top Pin
David Crow28-Jul-04 3:46
David Crow28-Jul-04 3:46 
GeneralCDialog Help! Pin
Pazzuzu27-Jul-04 1:10
Pazzuzu27-Jul-04 1:10 
GeneralRe: CDialog Help! Pin
Ivan Cachicatari27-Jul-04 4:06
Ivan Cachicatari27-Jul-04 4:06 
GeneralRe: CDialog Help! Pin
David Crow27-Jul-04 4:06
David Crow27-Jul-04 4:06 
GeneralRe: CDialog Help! Pin
Pazzuzu27-Jul-04 4:22
Pazzuzu27-Jul-04 4:22 
GeneralRe: CDialog Help! Pin
Pazzuzu27-Jul-04 5:11
Pazzuzu27-Jul-04 5:11 
GeneralRe: CDialog Help! Pin
David Crow27-Jul-04 7:53
David Crow27-Jul-04 7:53 
GeneralRe: CDialog Help! Pin
Pazzuzu28-Jul-04 4:20
Pazzuzu28-Jul-04 4:20 
GeneralRe: CDialog Help! Pin
Jaime Stuardo27-Jul-04 5:09
Jaime Stuardo27-Jul-04 5:09 
QuestionAre parameters/member variables safe for threading ? Pin
Hesham Amin27-Jul-04 0:39
Hesham Amin27-Jul-04 0:39 
Hi i make 1 instance of CMyClass in the ThreadProc function and call Init member function :
int CMyClass::Init(int ID)<br />
{<br />
	m_ChID=ID;<br />
	int res=pInitChannel(m_ChID);<br />
<br />
	if(0==res)<br />
		return true;<br />
	else<br />
	{<br />
		ReportError(res);<br />
		return false;<br />
	}<br />
}

I know (and correct me if wrong) that the ID parameter and m_ChID are safe.
I mean that if i pass 0 from a thread and 1 from another then there is no chance that m_ChID member will have the same value 0 or 1 for both instances since m_ChID is not a shared variable..

the problem that arises that the library i call (which have the global pInitChannel function) should be thread safe but i get an error that indicates that I pass the same ID more than once (which is not allowed).

now the question is :
Am I wrong with my concepts or does the library i use have problems with multithreading ?

thank you for reading

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.