Skip to content

Instantly share code, notes, and snippets.

@shawnkoon
shawnkoon / midterm_studyGuide.md
Created February 17, 2017 08:44
CSCD467 midterm study guide

CSCD467 Parallel & Cloud Computing Midterm Study guide.

Author : shawnkoon. Web : github.com/shawnkoon

  1. Concept of barrier and semaphore
  • Barrier - Datastructure that allows threads to wait for each other to reach a same barrier point. CyclicBarrier - barrier that is re-used after the threads are released.

  • Semaphore - Datastructure that maintains a set of permits and it ensures that only N threads can access a certain resource at a given time. Tip : Why getItem() method is not synchronized? A : because semaphore encapsulates the synchronization inside itself.