Skip to content
operational 998 B
Newer Older
Yuanle Song's avatar
Yuanle Song committed
* COMMENT -*- mode: org -*-
#+Date: 2018-01-25
Time-stamp: <2018-01-25>
#+STARTUP: content
* notes                                                               :entry:
* later                                                               :entry:
* current                                                             :entry:
** 
** 2018-01-25 Dining philosophers problem - Wikipedia
https://en.wikipedia.org/wiki/Dining_philosophers_problem

- traditional solution using locks

        p1
     f5    f1
  p5          p2
   f4        f2
     p4    p3
        f3

  may deadlock if not well designed.

Yuanle Song's avatar
Yuanle Song committed
  implemented in ./src/Dining1.hs

Yuanle Song's avatar
Yuanle Song committed
- use haskell STM

Yuanle Song's avatar
Yuanle Song committed
  still have no idea when and how to use it.

  Parallel and Concurrent Programming in Haskell
  http://chimera.labs.oreilly.com/books/1230000000929/ch10.html

  quite easy to implement.

Yuanle Song's avatar
Yuanle Song committed
* done                                                                :entry:
* wontfix                                                             :entry: