Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: