vga-framebuffer-rs icon indicating copy to clipboard operation
vga-framebuffer-rs copied to clipboard

Avoid undefined behaviour with atomics

Open thejpster opened this issue 6 years ago • 0 comments

Relaxed atomics should be a low-cost way to avoid undefined behaviour when we have one thread (the video interrupt) reading the framebuffer and another thread (the main thread) writing to it.

Probably best to split the framebuffer into three parts:

  • A reader (for the video interrupt)
  • A reader/writer (for the main thread)
  • A shared memory area (an array of AtomicU8 or AtomicU16, or maybe two arrays of AtomicU8?)

thejpster avatar Oct 29 '19 09:10 thejpster