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: 
  let n = 7 ;
  
  let thinking = Array.create n ((uint64)0)
  let eating   = Array.create n ((uint64)0)
  
  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
  
negative.code: timer.Start()
  
  let rec main () = 
      let forks = Array.init n (fun _ -> newTVar(true))
      for i in 0..n-1 do
          forkIO (philosofer i forks.[i] forks.[(i + 1) % n])
      
  let onInterrupt _ _ =
      timer.Stop()
      printf "\ndone.\n"
      let total = float timer.ElapsedMilliseconds
      let p x = ((float x) * 100.0) / (float total)
      for i in 0..n-1 do
          printf "philosopher [%d] - percents: %.2f eating, %.2f thinking, %.2f obtaining forks\n"
              i (p eating.[i]) (p thinking.[i]) (100. - (p eating.[i] + p thinking.[i]))
      
  Console.CancelKeyPress.AddHandler( new ConsoleCancelEventHandler( onInterrupt ))
  
  main()