[pso] Probleme Threaduri in C++
Gabriel Bercea
gamitech at gmail.com
Sun May 17 15:48:53 EEST 2009
1) Nu iesiti din thread cu exit thread si doar cu return
2) Sa nu aveti peding operations asociate cu threadul
3) Cum iti dai seama ca nu s-a terminat threadul ? cum testezi asta ?
finally, din explicatia data initial nu inteleg de fapt care e pbema, si
nici comportamentul aplicatiei ??
ai 5 threaduri, p care le pornesti si au fiecare cate un StartRoutine sau
5 start routines diferite ? Please be a little more concrete
2009/5/17 Alexandru Bleotu <alexbleotu at gmail.com>
> Threadul principal nu moare... mai mult doua dintre threaduri continua...
> banuim ca este vorba despre memory corruption
>
> 2009/5/17 Mircea Bardac <cs at mircea.bardac.net>
>
> Salut,
>>
>> ovidiu popa wrote:
>> > Am o aplicatie in C++ care porneste 5 threaduri.
>> > In momentul in care functia asociata unui thread ajunge la sfarsitul
>> > executiei se incheie executia si a altui thread care ar trebui sa ruleze
>> o
>> > bucla infinita...
>>
>> Nu sunt convins ca am inteles bine problema asa ca o sa reformulez un
>> pic: cand se termina thread-ul 1, observi ca s-a terminat si thread-ul 2
>> cu toate ca thread-ul 2 ar trebui inca sa mai ruleze.
>>
>> O idee: verifica faptul ca in thread-ul principal (acolo unde creezi
>> cele 2 thread-uri) astepti ambele thread-uri, nu doar thread-ul 1
>> (WaitForSingleObject/WaitForMultipleObjects). Daca astepti doar
>> thread-ul 1, thread-ul principal isi va continua executia => aplicatia
>> se va termina (ExitProcess) => toate thread-urile aplicatiei vor fi
>> terminate.
>>
>> Good luck.
>>
>> --
>> Mircea
>> http://mircea.bardac.net
>> _______________________________________________
>> pso mailing list
>> pso at cursuri.cs.pub.ro
>> http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/pso
>>
>
>
> _______________________________________________
> pso mailing list
> pso at cursuri.cs.pub.ro
> http://cursuri.cs.pub.ro/cgi-bin/mailman/listinfo/pso
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cursuri.cs.pub.ro/pipermail/pso/attachments/20090517/d7fd6360/attachment-0001.htm>
More information about the pso
mailing list