I haven't tested this yet but should be fine. This will be optimized to only save state from threads that are using it