Changeset 5d81edb


Ignore:
Timestamp:
May 31, 2023, 8:45:46 AM (11 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ast-experimental, master
Children:
8421d3f
Parents:
d8d9c115
Message:

wording changes in channel chapter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/theses/colby_parsons_MMAth/text/channels.tex

    rd8d9c115 r5d81edb  
    300300Implementing a barrier is interesting because threads are both producers and consumers on the barrier-internal channels, @entryWait@ and @barWait@.
    301301The outline for the barrier implementation starts by initially filling the @entryWait@ channel with $N$ tickets in the barrier constructor, allowing $N$ arriving threads to remove these values and enter the barrier.
    302 After @entryWait@ is empty, arriving threads block when removing from @entryWait@.
     302After @entryWait@ is empty, arriving threads block when removing.
    303303However, the arriving threads that entered the barrier cannot leave the barrier until $N$ threads have arrived.
    304 Hence, the entering threads block on the @barWait@ channel until the $N$th arriving thread inserts $N-1$ elements into @barWait@ to unblock the $N-1$ threads calling @remove@ on the @barWait@ channel.
     304Hence, the entering threads block on the empty @barWait@ channel until the $N$th arriving thread inserts $N-1$ elements into @barWait@ to unblock the $N-1$ threads calling @remove@.
    305305The race between these arriving threads blocking on @barWait@ and the $N$th thread inserting values into @barWait@ does not affect correctness;
    306306\ie an arriving thread may or may not block on channel @barWait@ to get its value.
     307Finally, the last thread to remove from @barWait@ with ticket $N-2$, refills channel @entryWait@ with $N$ values to start the next group into the barrier.
    307308
    308309Now, the two channels makes termination synchronization between producers and consumers difficult.
Note: See TracChangeset for help on using the changeset viewer.