cis 644 thus. oct. 28, 1999 w10b … misc. questions … thread, runable

24
IS 644 Thus. Oct. 28, 1999 W10B misc. questions thread, Runable communication patterns

Upload: mercer

Post on 28-Jan-2016

35 views

Category:

Documents


0 download

DESCRIPTION

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. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: CIS 644   Thus.   Oct. 28, 1999    W10B …  misc. questions …   thread, Runable

CIS 644 Thus. Oct. 28, 1999 W10B

… misc. questions

… thread, Runable

… communication patterns

Page 2: CIS 644   Thus.   Oct. 28, 1999    W10B …  misc. questions …   thread, Runable

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

Page 3: CIS 644   Thus.   Oct. 28, 1999    W10B …  misc. questions …   thread, Runable

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)

Page 4: CIS 644   Thus.   Oct. 28, 1999    W10B …  misc. questions …   thread, Runable

?? 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

Page 5: CIS 644   Thus.   Oct. 28, 1999    W10B …  misc. questions …   thread, Runable

?? “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.

Page 6: CIS 644   Thus.   Oct. 28, 1999    W10B …  misc. questions …   thread, Runable

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

Page 7: CIS 644   Thus.   Oct. 28, 1999    W10B …  misc. questions …   thread, Runable

my preference:

theAirports LOOP | getAirport( ; anAirport) -->| | anAirport | | getInfo( ) ----------------------->| ENDLOOP translates:

loop { anAirport = theAirports.getAirport( i );

}

Page 8: CIS 644   Thus.   Oct. 28, 1999    W10B …  misc. questions …   thread, Runable

??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"

Page 9: CIS 644   Thus.   Oct. 28, 1999    W10B …  misc. questions …   thread, Runable

?? c new(passenger; aReservation)

… converts to Java as:

aReservation = new Reservation(passenger)

Page 10: CIS 644   Thus.   Oct. 28, 1999    W10B …  misc. questions …   thread, Runable

?? Airports | c remove( anAirport) -->|

could translate as:

class Airports { Airport[ ] items; … void remove( integer i) { items[ i ] = null ; }

}

Page 11: CIS 644   Thus.   Oct. 28, 1999    W10B …  misc. questions …   thread, Runable

?? * getValues( ; values)

… * indicates a loop … calls to multiple objects from the collection

Page 12: CIS 644   Thus.   Oct. 28, 1999    W10B …  misc. questions …   thread, Runable

threads use comments: threads are used in: CIS625 distributed Processing CIS725 Computer Networks

Page 13: CIS 644   Thus.   Oct. 28, 1999    W10B …  misc. questions …   thread, Runable

I use Solaris threads & Posix threads.

I use the ACE framework (thread details are hidden within)… at Motorola

Page 14: CIS 644   Thus.   Oct. 28, 1999    W10B …  misc. questions …   thread, Runable

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 )

Page 15: CIS 644   Thus.   Oct. 28, 1999    W10B …  misc. questions …   thread, Runable

.. 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

Page 16: CIS 644   Thus.   Oct. 28, 1999    W10B …  misc. questions …   thread, Runable

we use concurrency ...in modeling aircraft systems for real-time simulation

-----------------------------------------------------

threads (multiple processes) are becoming more common in systems we are developing

Page 17: CIS 644   Thus.   Oct. 28, 1999    W10B …  misc. questions …   thread, Runable

?? 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

Page 18: CIS 644   Thus.   Oct. 28, 1999    W10B …  misc. questions …   thread, Runable

continuing into Chaps 4 & 5:

Coad: "this is easy" :-(

UML: objects: passive vs active active: process vs thread

ADA: object vs task

Page 19: CIS 644   Thus.   Oct. 28, 1999    W10B …  misc. questions …   thread, Runable

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 ownthread, as Sensor version p. 194

Page 20: CIS 644   Thus.   Oct. 28, 1999    W10B …  misc. questions …   thread, Runable

or ..

Thread can execute several different runable objects (…invoke their run() ) … in sequence , of course.

Page 21: CIS 644   Thus.   Oct. 28, 1999    W10B …  misc. questions …   thread, Runable

threads can have priorities …

but current JVMs do not guarenteeexact mapping of priorities !!

Lea recommends:

HI … for system critical threads LO … for background threads

Coad mapping … p. 192 :-(

Page 22: CIS 644   Thus.   Oct. 28, 1999    W10B …  misc. questions …   thread, Runable

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.

Page 23: CIS 644   Thus.   Oct. 28, 1999    W10B …  misc. questions …   thread, Runable

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

Page 24: CIS 644   Thus.   Oct. 28, 1999    W10B …  misc. questions …   thread, Runable

End