Benutzer:MovGP0/Parallel

aus Wikipedia, der freien Enzyklopädie
Zur Navigation springen Zur Suche springen
   MovGP0        Über mich        Hilfen        Artikel        Weblinks        Literatur        Zitate        Notizen        Programmierung        MSCert        Physik      


Parallel Programming

[Bearbeiten | Quelltext bearbeiten]
Tasks vs. Threads
Task Thread
  • Task should be large, independent, and numerous enough to keep all cores busy
  • Task indicate potential concurrency and are executed in parallel when enough cores are available
  • Tasks should be decomposed and grouped so that data sharing is reduced and core utilization is maximized
  • Threads create immediate concurrency
Concurrency vs. Parallelism
Concurrency Parallelism
  • multiple threads with given time slot
  • provides each thread with computing time
    • prevents thread starvation
    • goal is to reduce latency
  • concurrent threads that execute at the same time
  • optimization method to maximize processor usage
  • process queues or stacks of work to be done

Scalability Considerations

[Bearbeiten | Quelltext bearbeiten]
  • reduce Locking by
    • using immutable classes
    • reducing shared variables
  • choose structure changes over bottleneck identification
  • use shared queues to communicate between threads
  • prefer tested high-level constructs
    • use libraries like TPL and PLINQ
    • use implicit parallelism from web and database servers
    • avoid threads and locks only as last resort

mit

  • = Speedup
  • = Anzahl der Prozesse
  • = Laufzeit des parallel ausgeführten Codes
  • = Laufzeit des seriell ausgeführten Codes
  • = Laufzeit für Synchronisierungsaufwand
  • = Laufzeit des parallelisierten Codes