Commit Graph

590 Commits

Author SHA1 Message Date
Michael Walker
220589f68c Use record syntax to get unC functions 2014-12-27 22:03:37 +00:00
Michael Walker
3957f5edfa 'Action's don't need the 't' 2014-12-27 15:38:56 +00:00
Michael Walker
7e6fcd4a39 Swap main Fixed implementation from IO to ST. 2014-12-27 12:26:40 +00:00
Michael Walker
d215306911 Implement a Fixed variant using ST to get a pure result.
Following discussion on Twitter, https://twitter.com/barrucadu/status/548496893127712768
2014-12-27 12:20:45 +00:00
Michael Walker
a1d637e87c Build a trace of thread actions in Fixed 2014-12-24 21:41:32 +00:00
Michael Walker
c9a40a8f41 Add racey stack test 2014-12-24 13:15:46 +00:00
Michael Walker
4430ed49eb More simple tests 2014-12-23 22:01:00 +00:00
Michael Walker
2f4d191efa Rename doTest to testPred 2014-12-23 16:30:46 +00:00
Michael Walker
a78f211919 Fix some hlint warnings 2014-12-23 15:51:46 +00:00
Michael Walker
889f53c062 Add dining philosophers tests 2014-12-23 15:50:25 +00:00
Michael Walker
9f5b04eb63 Add a little test framework, and a test case 2014-12-23 15:20:11 +00:00
Michael Walker
554fa84ec7 Enable -Wall and fix all warnings 2014-12-21 16:34:55 +00:00
Michael Walker
7819a3c7b0 Provide a helper function to turn Schedulers into SCTSchedulers 2014-12-21 13:50:52 +00:00
Michael Walker
875c5319ee Fix an inverted filter in Fixed 2014-12-21 13:50:37 +00:00
Michael Walker
37f3767290 Record possible alternative scheduling decisions in SCT 2014-12-21 13:25:48 +00:00
Michael Walker
d0e01c579a Fix type of example in SCT 2014-12-21 13:00:43 +00:00
Michael Walker
96eaf85095 Record in SCT trace reasons for decisions.
In particular, this lets us distinguish between switching to a new
thread because the old was blocked, or switching to a new thread
because of a pre-emption.
2014-12-21 12:48:15 +00:00
Michael Walker
8b0f2763d3 Add some helpful CVar combinators 2014-12-21 09:38:25 +00:00
Michael Walker
6a3e5f50c2 Add a 'tryPutCVar' primitive, and implement 'putCVar' in terms of it 2014-12-21 09:37:52 +00:00
Michael Walker
9a6fcc5162 Rename all CVar functions to avoid name clashes with Prelude. Fixes #1. 2014-12-21 07:47:45 +00:00
Michael Walker
5f85be3574 Simpler detection of deadlock in Fixed 2014-12-20 20:31:25 +00:00
Michael Walker
2a33b4a017 Add link to docs in README 2014-12-20 18:17:43 +00:00
Michael Walker
a36b949382 Add README 2014-12-20 17:32:35 +00:00
Michael Walker
0c879de41b Add a .travis.yml just to check it builds (todo: tests) 2014-12-20 16:02:09 +00:00
Michael Walker
82e9241686 Add a simple runner which gathers results and schedulings from multiple runs 2014-12-20 11:03:49 +00:00
Michael Walker
86a2617b41 Mutating a CVar only wakes up threads blocked on that CVar. 2014-12-20 10:42:58 +00:00
Michael Walker
df5756c812 Fix a couple of bugs in the Fixed runner 2014-12-20 09:20:48 +00:00
Michael Walker
41050131fb Prevent CVars from leaking out of a Conc computation 2014-12-20 07:45:18 +00:00
Michael Walker
374b8a5c4e Fix doc typo 2014-12-19 21:39:06 +00:00
Michael Walker
00e7a420ee Clarify Fixed.Scheduler docs, and properly detect deadlock in runThreads 2014-12-19 21:34:53 +00:00
Michael Walker
982534f572 Bump base upper bound (silly Ubuntu) 2014-12-19 21:30:38 +00:00
Michael Walker
50944f0d95 Implement a round-robin scheduler 2014-12-19 07:21:00 +00:00
Michael Walker
88535bb5ff Optionally return the final scheduler state 2014-12-19 07:12:22 +00:00
Michael Walker
bc7607ad24 Implement a simple random scheduler 2014-12-19 07:09:26 +00:00
Michael Walker
44593b43cc Re-export and document all primitives from Fixed 2014-12-19 06:59:41 +00:00
Michael Walker
83fb25a6d7 Add a ConcFuture/ConcCVar which is parametrised by a fixed scheduler. 2014-12-19 06:45:50 +00:00
Michael Walker
070d034de9 Implement IO's 'spawn' in terms of other conc primitives 2014-12-19 06:24:50 +00:00
Michael Walker
9361499b01 Drop 'spawnP', as it only really makes sense for NFData 2014-12-18 18:22:50 +00:00
Michael Walker
f2dae49d71 Add ConcFuture/ConcCVar MVar+IO implementations 2014-12-18 11:18:06 +00:00
Michael Walker
8ab914c7d5 Initial commit: a class for monads providing concurrency. 2014-12-18 11:03:17 +00:00