240 likes | 254 Views
CIS 644 Thus. Oct. 28, 1999 W10B … misc. questions … thread, Runable … communication patterns. Exam1 … covers: class & scenario models open book … < 1.5 hours Tues Nov 2. on campus … in class off campus … sent email 4:30pm C.T.
E N D
CIS 644 Thus. Oct. 28, 1999 W10B … misc. questions … thread, Runable … communication patterns
Exam1 … covers: class & scenario models open book … < 1.5 hours Tues Nov 2. on campus … in class off campus … sent email 4:30pm C.T. email or fax it back
administrative: > corrections to GRADES file are being made … will be reposted later. > CIS web server was “killed” this week … temporarily moved … … some scripts may not work CIS644 local pages should be OK now. > I keep up with “urgent” email … rest may wait for a while (will post patterns lists later)
?? are GRADES 4 digits SSN number? ... they are KSU student ID number. ?? send back off-campus homework … no … just class discussion ?? post “my answer” … no … posted TA’s answer
?? “1.5” hours for exam … on-campus ... up to 90 minutes … off-campus … honor system will draw some diagrams … FAX is OK … “asap” if you want to use Rose or other tool, great … don’t count that as part of exam time.
review questions: "class variables" , "class markers" (page 21) c getList( ; list) … there are times with class methods are required Coad’s use of class methods for collections is optional … not my preference
my preference: theAirports LOOP | getAirport( ; anAirport) -->| | anAirport | | getInfo( ) ----------------------->| ENDLOOP translates: loop { anAirport = theAirports.getAirport( i ); }
??is this related to aggregation vs composition ?? … no … I see A vs C as who owns the items who is responsible for keeping refs UML … what are the items "part of"
?? c new(passenger; aReservation) … converts to Java as: aReservation = new Reservation(passenger)
?? Airports | c remove( anAirport) -->| could translate as: class Airports { Airport[ ] items; … void remove( integer i) { items[ i ] = null ; } }
?? * getValues( ; values) … * indicates a loop … calls to multiple objects from the collection
threads use comments: threads are used in: CIS625 distributed Processing CIS725 Computer Networks
I use Solaris threads & Posix threads. I use the ACE framework (thread details are hidden within) … at Motorola
at Sprint: ...Every application … is multi-threaded ... created our own thread classes in C++ ( inconsistencies with the standard class) e.g. * credit card validation (C++) … allows concurrent requests * vendor communication (C++) … allows concurrent requests * orders system (Java) .. Enterprise Java Beans framework (hidden multi-threads )
.. some Java threads. .. more with multi-tasking in real-time OS (OS-9, iRMX, Unison, VersaDos) using C …these OS's have features such as: mailboxes, signals, shared memory for intertask communication semaphores to control access
we use concurrency ...in modeling aircraft systems for real-time simulation ----------------------------------------------------- threads (multiple processes) are becoming more common in systems we are developing
?? was there only one thread in the Video Store?? … Chap 1 … yes … real… no… need to define the "system" arch. assume: one processor, many agents in PD … should be multiple Agent tasks, each with own UI
continuing into Chaps 4 & 5: Coad: "this is easy" :-( UML: objects: passive vs active active: process vs thread ADA: object vs task
Java: Runable interface defines run() but is not per se active object Thread implements Runable and is active object Runable object can be executed "in" (with ??) its own thread. … pass object to Thread(Obj) . or, Runable object can make its own thread, as Sensor version p. 194
or .. Thread can execute several different runable objects (…invoke their run() ) … in sequence , of course.
threads can have priorities … but current JVMs do not guarentee exact mapping of priorities !! Lea recommends: HI … for system critical threads LO … for background threads Coad mapping … p. 192 :-(
visual representation of active objects: … at Java level, only Thread is really active, … at design (abstract) level, Runable objects can be "active" :-( Coad does not show bold boxes __ __ Ada: /__ / for Task vs [__] for obj.
skim Chap 4, 5 for overview: several different forms for communication passive (polling) timer active (source notifies its listeners) message vs notification: of course, at Java level, notification implemented as message