3 ms·
I've done some threaded code - and certainly not an expert, but my tips would be: 1. don't use global variables 2. when sharing data between threads - use mes
by david422 3y ago
I've done some threaded code - and certainly not an expert, but my tips would be:
1. don't use global variables
2. when sharing data between threads - use message queues, not objects
3. if you do have shared objects, make your public methods thread safe by using mutexes and your internal methods don't need mutexes