page_title: Multiple buffering
section_title: Double buffering Petri net
hierarchical_section_title: Multiple buffering / Description / Double buffering Petri net
caption_attribution_description: English: Petri Net that shows how double buffering works.
context_page_description: In computer science, multiple buffering is the use of more than one buffer to hold a block of data, so that a "reader" will see a complete version of the data, rather than a partially updated version of the data being created by a "writer". It is also used to avoid the need to use dual-ported RAM when the readers and writers are different devices.
context_section_description: The Petri net in the illustration shows how double buffering works. Transitions W1 and W2 represent writing to buffer 1 and 2 respectively while R1 and R2 represent reading from buffer 1 and 2 respectively.
  At the beginning only the transition W1 is enabled. After W1 fires, R1 and W2 are both enabled and can proceed in parallel. When they finish, R2 and W1 proceed in parallel and so on.
  So after the initial transient where W1 fires alone, this system is periodic and the transitions are enabled – always in pairs (R1 with W2 and R2 with W1 respectively).
caption: Double Buffering Petri Net
exif: {}