anchor.diff:  open FSharpx.Stm
   
   let check p =
  -  match p with
  -  | true -> stm.Return(())
  -  | false -> retry ()
  +    match p with
  +    | true -> stm.Return(())
  +    | false -> retry ()
   
   let forkIO (f : unit -> unit) = (new Thread(f)).Start()
   
  
positive.code: timer.Start()
  
  let rec main () = 
      let forks = Array.map (fun x -> newTVar(true)) [| 0..(n-1) |]
      List.iter (fun i -> forkIO (philosofer i forks.[i] forks.[(i + 1) % n] )) [0..(n-1)]
      
  let onInterrupt _ _ =
      timer.Stop()
      printf "\ndone.\n"
      let total = (float)timer.ElapsedMilliseconds
      let p x  = 
          (((float)x)*100.0)/(float)total
      List.iter (fun i -> 
          (printf "philosopher [%d] - percents: %.2f eating, %.2f thinking, %.2f obtaining forks\n"
          i (p(eating.[i])) (p(thinking.[i])) ((float)100 - (p(eating.[i]) + p(thinking.[i]))))
      ) [0 .. n-1]     
      
  Console.CancelKeyPress.AddHandler( new ConsoleCancelEventHandler( onInterrupt ))
  
  do main ()
negative.code: 
  let n = 7 ;
  
  let thinking = Array.zeroCreate n
  let eating   = Array.zeroCreate n
  
  let randomDelay () = 
      let waitTime = rng.Next(1000)
      Thread.Sleep waitTime
      uint64 waitTime
  
  let eatOrThink i left_fork right_fork = 
      if (rng.Next(100)) > 50
      then 
          adquire left_fork right_fork
          printf "philosopher [%d] is eating.\n" i
  