If a function uses any static variables or global

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: areful with libraries. If a function uses any static variables (or global memory) it’s not safe to use with threads! Thread Summary Threads are awesome, but dangerous. You have to pay attention to details or it's easy to end up with code that is incorrect (doesn't always work, or hangs in deadlock). Posix threads provides support for mutual exclusion, condition variables and threadspecific data. References https://computing.llnl.gov/tutorials/pthreads/ http://www.cs.rpi.edu/~hollingd/netprog. 2003/notes/threads/threads.ppt...
View Full Document

Ask a homework question - tutors are online