[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: [SCICOMP] Parallel Programmering Med Linux



> Jeg er igang med at lave et simpelt program som skal koere paa to
> processorer ( i en maskine). Jeg bruger pthreads til dette formaal, og har
> dermed to traade der skal koere paa hver sin processor. Traad 1 er
> selvstaendig og regner loes paa nogle tal som den loebende indsaetter i et
> array i indeks raekkefoelge. Arrayet er allokeret dynamisk, og den
> function som koerer i traaden har faaet en reference til arrayet. Udover
> arrayet, er der en global variabel, progress, (deklareret som volatile)
> som faar tildelt det indeks som arrayet lige er blevet fyldt med. 
> 
> Den anden traad laeser progress, og ser om det entry i arrayet er blevet
> fyldt af traad 1. Hvis ja, saa bruges vaerdien. Dette goer den  indtil
> alle elementer i array er loebet igennem.
> 
> Mine problemer er to:
> 
> 1- Jeg har et problem med at traad 1 haenger lige pludselig, selvom den er
> selvstaendig.

Hænger? har du slået debugging til så du kan se hvor den hænger?
Uden at vide noget som helst om thread programmering (jeg kender kun parallelisering
over flere maskiner) må du kunne beskrive problemet lidt mere præcist.

> 
> 2- Jeg faar nogen gange en segmentation fault naar traad 2 laeser fra
> arrayet.

Igen Debug info?

Sune



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:34 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *