This commit is contained in:
Ilkka Seppälä committed 2019-12-13 21:09:28 +02:00
1 parent 0335c61512
commit b2b1ba95eb
127 files changed
+282 -450

No files matched your search

+3 -6
View File
@@ -3,10 +3,10 @@ layout: pattern
title: Double Buffer
folder: double-buffer
permalink: /patterns/double-buffer/
categories: Other
categories: Behavioral
tags:
- Java
- Difficulty-Beginner
- Performance
- Game programming
---
## Intent
@@ -19,11 +19,8 @@ Double buffering is a term used to describe a device that has two buffers. The u
This pattern is one of those ones where you’ll know when you need it. If you have a system that lacks double buffering, it will probably look visibly wrong (tearing, etc.) or will behave incorrectly. But saying, “you’ll know when you need it” doesn’t give you much to go on. More specifically, this pattern is appropriate when all of these are true:
- We have some state that is being modified incrementally.
- That same state may be accessed in the middle of modification.
- We want to prevent the code that’s accessing the state from seeing the work in progress.
- We want to be able to read the state and we don’t want to have to wait while it’s being written.
## Credits