[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: [CPROG] parallelisering



On Mon, 27 Mar 2000, Sune Fischer wrote:

> 
> 
> 
> > > Jeg må sige jeg er en smule forundret, brugte
> søndagen på at parallelisere et program, det lykkedes
> perfekt med en paralleliseringsgrad på ca. 95 procent.
>  
> > Hvordan måler du dette?
> 
> I princippet er det jo let, jeg har en loop der kører
> N gange, nu kører jeg bare to loops N/2 gange. Så
> skulle arbejdet være ligeligt fordelt, så er der det
> løse udenom der ikke er paralleliseret, derfor lidt
> mindre en 100% (eller skulle jeg sige 200%).

Hmmmm.
---------
int sum = 0;
int i;
for (i = 0; i < 10000; i++) {
  sum++;
}
---------
kan ikke (med fordel) paraleliseres til 

---------
int sum = 0;
int i; 
semaphor_hvad_ved_jeg sem = INIT_SEM;

process 1 og 2:
for (i = 0; i < 5000; i++) {
  lock(sem);
  sum++;
  release(sem);
}
----------

Så, det har en paralleliseringsgrad på 0....

Mads

-- 
Mads Bondo Dydensborg.                               sslug@sslug
The Microsoft Dictionary

           multi-platform: Works with both Windows NT Workstation and
                           Windows 2000 Professional.



 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2005-08-10, 20:08 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] *