significant corrections to thread synchronization and memory management