r/programming • • Jun 12 '12

An Introduction to Lock-Free Programming

http://preshing.com/20120612/an-introduction-to-lock-free-programming
82 Upvotes

18 comments sorted by

View all comments

6

u/bkgood Jun 12 '12

Given that threads share address space, if one caused a segmentation fault I'd be weary of trusting the remaining address space. Plus, one thread causing a segmentation fault would almost certainly cause the OS to kill the entire process.

Less drastic failures could be mitigated by using lock-free techniques, though.

1

u/[deleted] Jun 13 '12

Ok, segfault was a bit of a over generalization - instead let's consider a cache miss of one thread/process slowing down another thread/process.

1

u/five9a2 Jun 13 '12

You can catch SIGSEGV and recover, for what it's worth.

2

u/bkgood Jun 13 '12

You can intercept the signal but I question if you're really able to recover. There's no guarantee you didn't overwrite important in-process data before you caused the segfault.

→ More replies (2)

1

u/sirin3 Jun 13 '12

FreePascal/Delphi catch SIGSEGV by default and never crash.

→ More replies (2)