Lecture Note 1

Download Report

Transcript Lecture Note 1

Welcome to CS697B!
Special Topics on Concurrent and Distributed
Systems
Tue Thu 8:30pm to 9:45 :-(
http://www.cs.umb.edu/~jxs/courses/2007/697/
Course Topics
• Object-oriented concurrent systems
– Processes and threads
– Concurrency principles and techniques
– Java threads
– Design patterns for threading
• Object-oriented distributed systems
– TCP and UDP
– Socket interface
– I/O techniques
– Design patterns for socket and I/O handling
– Remoting middleware including Java RMI, corba
2
Course Work
• Lectures
• Homework -> [email protected]
– Reading
– Programming exercises
– Project
• Student presentations
3
Grading
• Grading factors
– Programming exercises (in Java) (40%)
– Deliverables of a course project (40%)
– Student presentations (20%)
• No textbooks!
• No midterm and final exams!!
4
Processes in an Operating System
Processes
• One of the most important concepts in all
operating systems
• A process is a container (or execution
environment) for a program (software) in
execution.
• In terms of operating systems, a software
system is a collection of processes.
6
Example Processes
7
Multi-Tasking (Time Sharing)
• Any modern OS support multi-tasking.
– e.g., writing a document with MS Word, while
listening music with iTunes and downloading a file.
• At any moment, a CPU can execute a single
program.
• Pseudo parallelism: an OS periodically assigns
one program to another to a CPU
– every several tens of milliseconds to several
hundreds of milliseconds
– A CPU is multiplexed among processes; processes
are not executed in a completely parallel manner.
8
Process State
• As a process runs, it changes its state.
New
Terminated
admitted
Dispatched to a CPU
exit
Ready
Running
interrupted
I/O or event
completion
Waiting
(Blocked)
I/O or event wait
9
New
Terminated
admitted
Dispatched to a CPU
exit
Ready
Running
interrupted
I/O or event
completion
Waiting
(Blocked)
I/O or event wait
• New
– A process is being created
• Ready
– Waiting to be assigned to a CPU
• Running
– A program is being executed.
• Waiting
– Waiting for some event to occur (I/O completion or signal reception)
• Termination
– Execution finished.
10
• cat file1 file2 file3 | grep UMB
• InputStreamReader fp =
new InputStreamReader(System.in);
fp.read();
11