.Open CS320/16 Concurrency and Java .Table .Row Prev 15 OO Programming and Java Chapter 2 section 17 + Java Handout + Chapter 12 lab15 Java101 .Row 16 Concurrency and Java Chapter 13 not sect'n 9 lab16 Java102 .Row Next 17 Exceptions Chapter 14 lab17 Java103 .Close.Table .Open Preparation -- Chapter 13 -- Concurrency Study notes below and Chapter 13, but not section 9 (not on the final). You can forget about MIMD/SIMD in this class (not on the final). Don't answer review questions on hardware. They are not on the Final. .Close .Open Notes . Concurrency is often faked: One single processor or computer can work as if it had many processors. All modern operating systems use concurrency. The introductory definitions and ideas in the book are important. The various forms of hardware (MIMD and SIMD) and FORTRAN based concurrency can be ignored. Take our advanced architecture courses for this and/or talk to Dr. Gomez. You need to understand .List threads semaphores, monitors, deadlocks etc. .Close.List Because .List They turn up all over the place: web sites, data bases, mail handlers, commercial transactions, system administration, etc.. They are used in interview questions. They are a part of Java: .See http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Thread.html .Close.List . Threads are easier than networks .See http://software.intel.com/file/14723 . Ada The ideas in Ada are simple to use .Set rendezvous. Protected records The "message passing" model is simple, reliable, and flexible. .Close.List . Some concurrency bugs are hard to find by testing. .List Use simple and sure techniques: message passing and rendezvous. Use logical model checking tools to look for the rare combinations of events that cause bugs. Take CSci556: Formal Methods. .Close.List . Java Thread .Image 16Threads.png [Classes Object Thread and interface Runnable] . Examples of Concurrency Look in these directories: .See http://cse.csusb.edu/dick/cs320/sieve/ .See http://cse.csusb.edu/dick/cs320/crypto/ . Missing -- UNIX pipes .List Simple to use message passing Also in Java Symbol | Example .As_is ls|grep 320 .Close.List For A,B:commands, A|B::command=`connects the output of A to the input of B and executes them in parallel`. Examples .As_is ls|wc -l lists files and counts them. (ls =list, wc -l = count lines) .As_is ls|grep 320|wc -l list files, filters out those with '320' in the name and counts them. .As_is grep -l 320 *|wc -l counts the number of files with '320' inside them. .As_is ps -elf|grep $USER lists all processes and filters out those with your name in them... including the two processes 'ps -elf' and 'grep'. . Why people do not like concurrency .See https://joindiaspora.com/posts/1653418 .Close Notes . Class Work .See http://www/dick/cs320/16q.html .Close . Lab Work .See ./lab/16.html . Next .See ./17.html