Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
courses:cs377-202651:week12 [2026/04/21 14:38] – [Linda and Tuple Space] mlsmithcourses:cs377-202651:week12 [2026/04/23 15:09] (current) – [Linda and Tuple Space] mlsmith
Line 17: Line 17:
       * Tech notes:       * 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: <code text> id = ARGV[0]</code>         * 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: <code text> id = ARGV[0]</code>
-        * then use a for loop from the bash prompt to run multiple producers/consumers: <code text> $ for i in {1..3}+        * then use a for loop from the bash prompt to run multiple producers/consumers: <code text>$ for i in {1..3}
 > do ruby producer.rb $i & > do ruby producer.rb $i &
 > done > done
 </code> </code>
         * and similarly to launch a different number of consumers         * 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}}