From: Nikodemus S. <nik...@ra...> - 2008-11-07 10:28:07
|
On Fri, Nov 7, 2008 at 1:18 AM, Justin Grant <jgr...@gm...> wrote: > why would the same application code work just fine under > heavy load on single core systems but become very unstable on multi-core > systems ? Timing issues. Assume there is a non-thread-safe codepath that is relatively short (say a couple of dozen instructions, no syscalls.) To see the problem on a single core system you need to hit a context switch in the middle of it, *and* then get the other thread to execute the same codepath. On a multicore system your chances of a context switch are multiplied (assuming same average time-slice size), and additionally you can get two threads to really execute the piece in parallel. The *real* parallelism is the bit that makes the big difference, but more context-switches / real-time-unit helps too. Cheers, -- Nikodemus |