Practice meeting, Nov. 11th

2 views
Skip to first unread message

Lyle Kopnicky

unread,
Oct 28, 2019, 1:58:41 AM10/28/19
to pdxfunc
When: Monday, Nov 11th, 6:30-8:30pm

(not our usual first Monday)

Where: Collective Agency Downtown, Suite 1108, 511 SW 10th Ave, Portland, OR (opposite side of the floor from the elevators)

We'll discuss Chapter 13, "Parallel Programming Using Threads", of Parallel and Concurrent Programming in Haskell. Please read it beforehand. You may wish to try running the code examples from the book. At the meeting anyone will be able to present and contribute to the discussion.

Meetup link to RSVP:

Hope to see you then!

Lyle Kopnicky

unread,
Nov 11, 2019, 11:54:17 PM11/11/19
to pdxfunc
Great meeting! Amazingly, we got through the whole chapter. We spent a considerable amount of time trying to understand the operation of the first parallel version of the file finder, specifically:
  1. understanding how it satisfied the desired property of determinism, so that if something was found or an exception was thrown in the leftmost subdirectory, nothing that happened in any other subdirectory would matter to the result, even if it threw an exception,
  2. how the hierarchy of lists of Asyncs was built (it turns out there’s one list per directory),
  3. how the foldr over subfind worked (it was easiest to understand it as continuation-passing style, with ‘inner’ representing the continuation)
  4. the order of operations - i.e., what was happening concurrently, and which threads were waiting on which.
It turned out that if the leftmost subdirectory took a long time to search, then even if another subdirectory finished first, we still had to wait for the leftmost one to complete, in order to satisfy the desired deterministic semantics of preferring the leftmost result.

The rest of the chapter was pretty straightforward, albeit interesting, after that.

In the end it seemed like you may as well use ParIO for most impure parallel computations, since it does all kinds of fancy load balancing for you. The only caveat is that it doesn’t handle exceptions well.

The chapter ended with a challenge to solve this problem - to handle the exceptions well by layering a bit of code on top of ParIO. The author provides a solution in findpar5.hs, but why not give it a go yourself first?

- Lyle

--
You received this message because you are subscribed to the Google Groups "pdxfunc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pdxfunc+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pdxfunc/c40a13d3-fd02-41c8-9fbe-962ecd48f952%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages