mystikos
mystikos copied to clipboard
rework pid/tid assignment algorithm
Currently pid's and tid's are assigned using a simple increasing integer that wraps at some point (plus 100). This could cause conflicts when more than 4 billion threads have been created.
Instead we propose using a bit string that is 64536 bits (or 8192 bytes). We propose scanning from the last bit assigned and wrapping on end of bit string.