Critical regions - cl.cam.ac.uk

Critical regions - cl.cam.ac.uk

Concurrency a cautionary tale
Grand Central Dispatch (GCD) by Apple
API for lightweight threads
Work queues hold functions (or code blocks) to be called
Queues can manage concurrency, coordinate joining of tasks
GCD manages scheduling and processor assignment
A simple practical example:
Generating image thumbnails, for all files in a directory, on a quad-core machine.
http://www.mikeash.com/pyblog/friday-qa-2009-09-25-gcd-practicum.html
v1: Sequential program 984 seconds
v2: Nave parallelisation did not run
GCD spawns another thread each time one blocks
Each task (a) hits the disk, (b) allocates memory to decompress images
Then the OS starts swapping, i.e. more disk contention
and GCD spawns another thread
v3: Read files sequentially in a single task, compress in parallel 300 seconds
This is self-limiting, but can still thrash
(Used only 10GB RAM on a machine with 15GB!)
v4: Limit the number of tasks to 2 x number of CPU cores 279 seconds
The CPU is not the only resource that threads / processes must share.
Concurrency (and distribution) libraries provide programmer support, not solutions.
Cross address-space IPC

16

Recently Viewed Presentations

  • Fundamentals of Spectrophotometry Introduction 1.) Colorimetry An analytical

    Fundamentals of Spectrophotometry Introduction 1.) Colorimetry An analytical

    Absorption Spectrum By choosing different wavelengths of light (lA vs. lB) different compounds can be measured lA lB Fundamentals of Spectrophotometry Spectrophotometer 1.) Basic Design An instrument used to make absorbance or transmittance measurements is known as a spectrophotometer Fundamentals...
  • Upper Airways of Respiratory Tract  Laryngopharynx is lowermost

    Upper Airways of Respiratory Tract Laryngopharynx is lowermost

    Upper Airways of Respiratory Tract Laryngopharynx is lowermost portion of pharynx Air breathed and/or swallowed passes through laryngopharynx Swallowed materials pass through esophagus to get to stomach
  • Post Impressionism Seurat, Cezanne, and Van Gogh Sunday

    Post Impressionism Seurat, Cezanne, and Van Gogh Sunday

    Post Impressionism Seurat, Cezanne, and Van Gogh Sunday in The Park, Seurat This painting has 3,456,000 dots! Seurat's famous "A Sunday in the Park on the Island of La Grande Jatte" (more commonly known as "Sunday in the Park"), which...
  • Diapositiva 1 - Le Baobab Bleu

    Diapositiva 1 - Le Baobab Bleu

    J'ai monté les valises au grenier. DESCENDRE intransitif transitif direct Je suis descendu(e) à la cave. J'ai descendu les escaliers à toute vitesse. ENTRER intranstif transitif direct Je suis entré(e) dans la maison. J'ai entré un mot-clé dans le moteur...
  • PowerPoint Poster Template - Georgetown University

    PowerPoint Poster Template - Georgetown University

    Genscan exons & exon pairs Expressed Sequence Tags All Genscan [1] exons, including suboptimal exons, with probability > 0.001. All pairs of Genscan exons within 100Kb. 3 frame translation. Open reading frames ≥ 90 nucleotides. ESTs are short single-pass sequencing...
  • Performance Analysis and Power Estimation of ARM processor

    Performance Analysis and Power Estimation of ARM processor

    Performance Analysis and Power Estimation of ARM Processor ... Power Estimation Conclusion The performance gain in next generation of processors is offset by the increase in power consumption. Intel Xscale almost doubles the power consumption with about 10% performance gain...
  • Cognates & Colors

    Cognates & Colors

    Cognates, Colors & Simple Words Cognates German and English (long with Danish and Dutch) are related languages. Several words like "Park", "Computer" & "Ball" are exactly the same in both German and English in spelling (only the pronunciation is different).
  • Educator Preparation: Transforming the Profession Educator Preparation Staff

    Educator Preparation: Transforming the Profession Educator Preparation Staff

    Transmit data to PSC on a semi-annual schedule. GS3 collection and reporting is authorized in requirements of HB283, effective July 1, 2013. ... Talk about the Alliance and the fact that no other state (that we know of) has such...