Added solution with OS threads