Permalink
Browse files

split conc.tex up into multiple files, and add more text

  • Loading branch information...
1 parent b913957 commit 71bef70abff99d946a6c9e016609390eb6561b75 @simonmar committed Apr 17, 2012
Showing with 2,673 additions and 2,498 deletions.
  1. +3 −4 code/geturlscancel.hs
  2. +2 −6 doc/cefp.tex
  3. +530 −0 doc/conc-asyncex.tex
  4. +136 −0 doc/conc-ffi.tex
  5. +84 −0 doc/conc-fork.tex
  6. +38 −0 doc/conc-higher.tex
  7. +432 −0 doc/conc-mvar.tex
  8. +687 −0 doc/conc-server.tex
  9. +754 −0 doc/conc-stm.tex
  10. +7 −2,488 doc/conc.tex
@@ -29,10 +29,9 @@ data Async a = Async ThreadId (MVar (Either SomeException a))
async :: IO a -> IO (Async a)
async action = do
- var <- newEmptyMVar
- t <- forkIO ((do r <- action; putMVar var (Right r))
- `catch` \e -> putMVar var (Left e))
- return (Async t var)
+ m <- newEmptyMVar
+ t <- forkIO (do r <- try action; putMVar m r)
+ return (Async t m)
wait :: Async a -> IO (Either SomeException a)
wait (Async t var) = readMVar var
View
@@ -35,11 +35,7 @@
% concurrent connections can it cope with?
% - geturlscancel: wait isn't async-safe, make it so
-% ToDo:
-% - add exercises
-
% ToDo in the future:
-% \Subsection{conc-data}{Shared concurrent data structures}
% more about interpreting ThreadScope profiles
% * fix the Amdahl's law section. Reading the file strictly in
@@ -71,8 +67,8 @@
\definecolor{myred}{rgb}{1.0,0.0,0.0}
\newcommand{\pgwrapper}[2]{\textcolor{myred}{#1: #2}}
-% \newcommand{\ToDo}[1]{\pgwrapper{ToDo}{#1}}
-\newcommand{\ToDo}[1]{}
+\newcommand{\ToDo}[1]{\pgwrapper{ToDo}{#1}}
+% \newcommand{\ToDo}[1]{}
\input{haskell}
Oops, something went wrong.

0 comments on commit 71bef70

Please sign in to comment.