====== Week 12 ======
~~NOTOC~~
===== Linda and Tuple Space =====
* Lecture Notes: {{cs377-linda-lect1.pdf|PDF}}
* Assignment 6
* Due Thu, April 23
* Versions 2 and 3 from slides 11, 12 of {{cs377-linda-lect1.pdf|PDF}}
* (version 1 included in sample code)
* versions from slides 11 and 12 are the versions to implement
* Extra challenge:
* version 3 from slide 23
* run with multiple producers / consumers from the command line
* Tech notes:
* to pass a command line parameter into your ruby program (i.e., so each producer/consumer knows its id), use the ''ARGV'' array like this: id = ARGV[0]
* then use a for loop from the bash prompt to run multiple producers/consumers: $ for i in {1..3}
> do ruby producer.rb $i &
> done
* and similarly to launch a different number of consumers
* Demo: Marc will attempt a live demo running multiple producers and consumers from his version 3 -- hope this works! LOL\\ \\
* Tech notes 2:
* alternatively, we could seed TS with producer/consumer id tuples
* instead of passing in command line arguments via ''ARGV'' array
* then each producer process can ''ts.take'' their producer id tuple, and
* each consumer process can do the same for their consumer id tuple
* arguably, this is more in the spirit of a Linda/TS program, and less dependent on how different OS's provide support for launching Linda processes with command line arguments.
* Discussion: modeling one model of concurrency with another
* shared memory (critical sections, etc.)
* Golang: channels (message passing)
* Ruby/Rinda: Linda and Tuple Space
* We don't always get to choose our language/library/stack
* Shear Sort (time permitting)
* Lecture notes:{{ shearsort.pdf | PDF}}