vga-framebuffer-rs
vga-framebuffer-rs copied to clipboard
Avoid undefined behaviour with atomics
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?)