Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm not familiar with the area, so am likely missing something, but how do they do deterministic thread-level context switching? Something like:

  var_1 = 0  
  var_2 = 0
  
  thread_a:
    while true:
      something_complex()
      var_1 ++
  
  thread_b:
    while true:
      something_complex()
      var_2 ++
Under the quoted definition of determinism, for every point in time, var_1 and var_2 should have the same values across all executions. But this would seem to amount to ensuring that exactly the same number of instructions are executed each time a thread is scheduled.


You are exactly correct. Our hypervisor grants you this power (and then we use the power to explore as many possible values of var_1 and var_2 as we can, in case some of them trigger a concurrency bug, e.g.)


The resolution of your deterministic scheduler is probably not based on quanta like "instructions", right? More likely it takes traditional input like a stable clock tick?


Nifty! Thanks for the response.


ensuring that exactly the same number of instructions are executed each time a thread is scheduled

AFAIK this is possible by (mis)using performance counters.


Alex discusses this in the post. Performance counters were the first thing we tried, but alas they're non-deterministic about every one-in-a-trillion instructions.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: