Multi-threaded code across platforms