Содержание
- 4. Introduction מערכות המחשב (ומערכות ההפעלה) הראשונות: אפשרו הרצת תכנית אחת (בלבד) בו זמנית לתכנית המורצת היתה
- 5. מטרות השיעור להציג את ה"תהליך" (process) – תוכנית בהרצה (program in execution), לתאר מספר מאפיינים (features)
- 6. Process Concept בקורס נשתמש במושגים job ו- process כחליפיים Jobs – בד"כ מתייחס ל- batch systems
- 7. Process in Memory Usually temporary data (such as function parameters, return addresses, and local variables) –
- 8. Program and Process על-בסיס אותה תוכנית ניתן להריץ שני תהליכים או יותר (במקביל), כשלכל אחד יש
- 9. Process State במהלך ריצתו משנה התהליך את מצבו (state): new: The process is being created running:
- 10. Diagram of Process State
- 11. Process Control Block (PCB) Information associated with each process Process state Program counter – address of
- 12. CPU Switch From Process to Process
- 13. Process Scheduling Queues המטרה – שבכל עת יהיה תהליך שיכול לרוץ על המעבד (לצורך מקסום ניצולת
- 14. Ready Queue And Various I/O Device Queues
- 15. Representation of Process Scheduling Queuing Diagram Wait for the child to finish execution Why start at
- 16. Schedulers Long-term scheduler (or job scheduler) – selects which processes should be brought into the ready
- 17. Schedulers (Cont) ה- short-term scheduler נכנס לפעולה בצורה תדירה (כל מספר מילישניות): חייב להיות מהיר, אחרת
- 18. Schedulers (Cont) תהליכים מאופיינים כ: I/O bound – מבלים את רוב זמנם בפעולות I/O ומעט מאוד
- 19. Context Switch כאשר המעבד עובר לטפל בתהליך אחר, המערכת חייבת לשמור את ה- state של התהליך
- 21. Process Creation Creating a process – using create process system call Parent process create children processes,
- 22. Process Creation (Cont) Execution Parent and children execute concurrently Parent waits until children terminate Address space
- 23. Process Creation
- 24. C Program Forking Separate Process int main() { pid_t pid; /* fork another process */ pid
- 25. Process Termination בסיום פעולתו נדרש התהליך להריץ את הפקודה exit: מערכת ההפעלה מוחקת אותו מרשמית התהליכים
- 26. Interprocess Communication תהליכים צריכים דרך לחלוק ולשתף מידע ביניהם: בין שרצים באותה מערכת ובין שרצים במערכות
- 27. Communications Models Better for exchanging small messages (no conflicts need to be avoided) Easier to implement
- 28. Producer-Consumer Problem Paradigm for cooperating processes, producer process produces information that is consumed by a consumer
- 29. Bounded-Buffer – Shared-Memory Solution Shared data #define BUFFER_SIZE 10 typedef struct { . . . }
- 30. Bounded-Buffer – Producer while (true) { /* Produce an item */ while (((in + 1) %
- 31. Bounded Buffer – Consumer while (true) { while (in == out) ; // do nothing --
- 32. Interprocess Communication – Message Passing מהווה מכאניזם לתקשורת וסנכרון בין תהליכים הרעיון הוא שהתהליכים יתקשרו ללא
- 33. Direct Communication Processes must name each other explicitly: send (P, message) – send a message to
- 34. Indirect Communication Messages are directed and received from mailboxes (also referred to as ports) Each mailbox
- 35. Indirect Communication Operations create a new mailbox send and receive messages through mailbox destroy a mailbox
- 36. Indirect Communication Mailbox sharing P1, P2, and P3 share mailbox A P1, sends; P2 and P3
- 37. Synchronization מנגנון ה- message passing יכול להיות מאופיין כ- blocking or non-blocking תצורת blocking נחשבת תצורה
- 38. Buffering Whether direct or indirect, messages must reside in a queue; implemented in one of three
- 39. Communications in Client-Server Systems Sockets Remote Procedure Calls Remote Method Invocation (Java)
- 40. Sockets A socket is defined as an endpoint for communication Concatenation of IP address and port
- 41. What is a socket? An interface between application and network The application creates a socket The
- 42. Socket Communication Server waits for incoming client requests by listening to a specified port Servers implementing
- 43. Remote Procedure Calls Remote procedure call (RPC) abstracts procedure calls between processes on networked systems Stubs
- 44. Remote Method Invocation Remote Method Invocation (RMI) is a Java mechanism similar to RPCs RMI allows
- 45. Marshalling Parameters The RMI principle: the definition of behavior and the implementation of that behavior are
- 47. Скачать презентацию