aboutsummaryrefslogtreecommitdiffhomepage
path: root/notes/threading_and_memory_safety.txt
blob: 6ae16136101e17fb234232c95594f2f0e2dbc215 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

Threading and memory safety
===========================

Simplest way to prevent incorrect lifetimes, double-free's, etc. due to
synchronization or memory ordering issues between threads:

* Require that reads from/writes to threaded variables NEVER change the
  lifetime of any data item.
* Have a builtin queue data structure, for safe passing of owned objects
  between threads.

The following types may need atomic reads/writes, to prevent corrupt data
(i.e. wild pointers, out-of-range integers, etc):
* Data references/pointers
* Function references/pointers
* Integers that have bit representations that represent invalid values
  (could be ALL integers on some hypothetic platforms, e.g. "DS9000")

How about data items with constraints?
How about "type states"?