2016/pthreads-hint3

From CS61
Revision as of 04:40, 21 July 2016 by Margo (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Here is the assembly produced:

   1. movl    (%eax), %eax
   2. movl    (%eax), %edx
   3. addl    $1, %edx
   4. movl    %edx, (%eax)

What if a thread gets descheduled between instructions 2 and 3?