Tuesday, April 11, 2006

Threads Cannot Be Implemented As a Library

Threads Cannot Be Implemented As a Library by Hans-J. Boehm. In PLDI'05. (PDF)

I read this paper for a presentation I had to do for Advanced Run Time Systems last year. Using Pthreads as an example, Boehm points out that implementing threads purely as a library can result in a number of errors which are difficult to find and resolve. The paper presents three examples:
  • concurrent modification — where races are introduced by optimisations ignorant of concurrency requirements;
  • rewriting adjacent data — where race conditions are introduced when variables protected by different locks are packed into the same memory location;
  • register promotion — where register promotion optimisations can modify protected variables outside of an atomic region.
As is mentioned in the Lambda the Ultimate discussion (linked below), this paper doesn't describe anything terribly new but it was an interesting read.

ACM | Google | Del.icio.us | CiteULike | LtU

No comments: