Thread safety and measurement control