Nguy ễ n Hoàng Tâm50702111 Nguy ễ n Văn Tr ọ ng50702651.

Slides:



Advertisements
Similar presentations
IPC (Interprocess Communication)
Advertisements

More on Processes Chapter 3. Process image _the physical representation of a process in the OS _an address space consisting of code, data and stack segments.
Chapter 3 Process Description and Control
Constructor. 2 constructor The main use of constructors is to initialize objects. A constructor is a special member function, whose name is same as class.
Module R2 Overview. Process queues As processes enter the system and transition from state to state, they are stored queues. There may be many different.
The Linux Kernel: Memory Management
1 SpaceWire Update NASA GSFC November 25, GSFC SpaceWire Status New Link core with split clock domains complete (Much faster) New Router core.
Informationsteknologi Wednesday, September 26, 2007 Computer Systems/Operating Systems - Class 91 Today’s class Mutual exclusion and synchronization 
Enforcing Mutual Exclusion Message Passing. Peterson’s Algorithm for Processes P0 and P1 void P0() { while( true ) { flag[ 0 ] = false; /* remainder */
Process Description and Control
The Process Model.
Process Description and Control Module 1.0. Major Requirements of an Operating System Interleave the execution of several processes to maximize processor.
Page 1 Processes and Threads Chapter Processes 2.2 Threads 2.3 Interprocess communication 2.4 Classical IPC problems 2.5 Scheduling.
1 Semaphores Special variable called a semaphore is used for signaling If a process is waiting for a signal, it is suspended until that signal is sent.
I/O Hardware n Incredible variety of I/O devices n Common concepts: – Port – connection point to the computer – Bus (daisy chain or shared direct access)
1 Process Description and Control Chapter 3. 2 Process Management—Fundamental task of an OS The OS is responsible for: Allocation of resources to processes.
Inter Process Communication:  It is an essential aspect of process management. By allowing processes to communicate with each other: 1.We can synchronize.
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
CSSE Operating Systems
1 Process Description and Control Chapter 3 = Why process? = What is a process? = How to represent processes? = How to control processes?
Process Description and Control A process is sometimes called a task, it is a program in execution.
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
BINA RAMAMURTHY UNIVERSITY AT BUFFALO System Structure and Process Model 5/30/2013 Amrita-UB-MSES
FreeRTOS.
Process Description and Control Chapter 3. Major Requirements of an OS Interleave the execution of several processes to maximize processor utilization.
Hardware Definitions –Port: Point of connection –Bus: Interface Daisy Chain (A=>B=>…=>X) Shared Direct Device Access –Controller: Device Electronics –Registers:
FINAL MPX DELIVERABLE Due when you schedule your interview and presentation.
Azure in a Day Training Azure Queues Module 1: Azure Queues Overview Module 2: Enqueuing a Message – DEMO: Creating Queues – DEMO: Enqueuing a Message.
1-1 Embedded Network Interface (ENI) API Concepts Shared RAM vs. FIFO modes ENI API’s.
Silberschatz, Galvin and Gagne  Operating System Concepts Cooperating Processes Independent process cannot affect or be affected by the execution.
Concurrency: Mutual Exclusion and Synchronization Chapter 5.
Chapter 41 Processes Chapter 4. 2 Processes  Multiprogramming operating systems are built around the concept of process (also called task).  A process.
Chapter 4 Processes. Process: what is it? A program in execution A program in execution usually usually Can also have suspended or waiting processes Can.
1 Lecture 5 (part2) : “Interprocess communication” n reasons for process cooperation n types of message passing n direct and indirect message passing n.
Queues, Pipes and Sockets. QUEUE A structure with a series of data elements with the first element waiting for an operation Used when an element is not.
Concurrency: Mutual Exclusion and Synchronization Chapter 5.
Computer Architecture and Operating Systems CS 3230: Operating System Section Lecture OS-4 Process Communication Department of Computer Science and Software.
RTX - 51 Objectives  Resources needed  Architecture  Components of RTX-51 - Task - Memory pools - Mail box - Signals.
Process Description and Control Chapter 3. Source Modified slides from Missouri U. of Science and Tech.
 Wind River Systems, Inc Chapter - 7 Intertask Communication.
IPC Message Queue. Data Structure msgque IP_NOUSED.
Lecture 4 Mechanisms & Kernel for NOSs. Mechanisms for Network Operating Systems  Network operating systems provide three basic mechanisms that support.
Processes 2 Introduction to Operating Systems: Module 4.
Silberschatz, Galvin, and Gagne  Applied Operating System Concepts Module 12: I/O Systems I/O hardwared Application I/O Interface Kernel I/O.
Distributed Computing & Embedded Systems Chapter 4: Remote Method Invocation Dr. Umair Ali Khan.
1 Module 3: Processes Reading: Chapter Next Module: –Inter-process Communication –Process Scheduling –Reading: Chapter 4.5, 6.1 – 6.3.
Module 12: I/O Systems I/O hardware Application I/O Interface
Chapter 13: I/O Systems Modified by Dr. Neerja Mhaskar for CS 3SH3.
Chapter 3: Process Concept
Lesson One – Creating a thread
Process Description and Control
System Structure and Process Model
Applied Operating System Concepts
System Structure and Process Model
Concurrency: Mutual Exclusion and Synchronization
Lecture 2: Processes Part 1
System Structure B. Ramamurthy.
System Structure and Process Model
Operating System Concepts
13: I/O Systems I/O hardwared Application I/O Interface
CS703 - Advanced Operating Systems
Process Description and Control
Process Description and Control
Process Description and Control
Process Description and Control
Process Description and Control
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Intertask Communication
Module 12: I/O Systems I/O hardwared Application I/O Interface
Presentation transcript:

Nguy ễ n Hoàng Tâm Nguy ễ n Văn Tr ọ ng

 Synchronization and communication : ◦ Passing variable-size messages ◦ Holding messages for sending and receiving ◦ 2 queues : messages waiting to be sent ( send queue),tasks waiting for messages receipt ( receive queue).

 Sender : ◦ Copy message to buffer ◦ If not enough space :  message is queued for sending until enough space is available.  task waiting to send is put in send queue

 Receipt : ◦ Message is fetched from buffer ◦ If buffer has no messages : task enter Wait state and put in receive queue  What if buffer size is 0 : ◦ Message communication function is synchronous ◦ Task wait for system call to be invoked ◦ Message is passed when both side issue system call

Synchronous Communication by Message Buffer

tk_cre_mbf : create message buffer  ID mbfid = tk_cre_mbf(T_CMBF *pk_cmbf)  pk_cmbf details : ◦ VPexinfExtended informations ◦ ATRmbfatrMessage buffer attributes ◦ INTbufszMessage buffer size ( in bytes ) ◦ INTmaxmsz Maximun massage size (in bytes )

Error code : - E_OK Normal completion - E_NOMEM Insu ffi cient memory (memory for control block or ring bu ff er area cannot be allocated) - E_LIMIT Number of message bu ff ers exceeds the system limit - E_RSATR Reserved attribute (mbfatr is invalid or cannot be used) - E_PAR Parameter error (pk cmbf is invalid, or bufsz or maxmsz is negative or invalid) mbfatr : - TA_TFIFO Tasks waiting to send are queued in FIFO order - TA_TPRI Tasks waiting to send are queued in priority order - TA_NODISWAI Wait disabling by tk dis wai is prohibited

 Notes : ◦ Tasks waiting for a message to be sent can be designated in TA_FIFO or TA_PRI ◦ Messages are queued in FIFO order only ◦ Tasks waiting for message receipt are queued in FIFO order only ◦ When there’re multiple tasks waiting to send, the order will always be obeyed in spite of buffer space ( enough or not )

tk_del_mbf : delete message buffer  ER recd = tk_del_mbf(ID mbfid) Error code : - E_OK : Normal completion - E_ID : Invalid ID number (mbfid is invalid or cannot be used) - E_NOEXS : Object does not exist (the message bu ff er designated in mbfid does not exist)

When this functions is called :  Release : message buffer space and control block  If there’re tasks queued in message buffer, error code E_DLT returned to the tasks in Wait state  If there’re message in buffer, it is deleted and no error code is returned

tk_snd_mbf : send message to message buffer  ER ercd = tk_snd_mbf ( ID mbfid, VP msg, INT msgsz, TMO tmout )  Parameter : - ID mbfid Message bu ff er ID - INT msgsz Send message size (in bytes) - VP msg Start address of send message packet - TMO tmout Timeout designation

Error code : - E_OK :Normal completion - E_ID :Invalid ID number (mbfid is invalid or cannot be used) - E_NOEXS : Object does not exist (the message bu ff er designated in mbfid does not exist) - E_PAR : Parameter error (msgsz · 0, msgsz > maxmsz,value that cannot be used in msg, or tmout · (¡2)) - E_DLT : The object being waited for was deleted (message bu ff er was deleted while waiting) - E_RLWAI : Wait state released (tk rel wai received in wait state) - E_DISWAI : Wait released by wait disabled state - E_TMOUT : Polling failed or timeout - E_CTX : Context error (issued from task-independent portion or in dispatch disabled state)

 Descriptions : ◦ Copy msgsz bytes starting at mgz to message queue of message buffer ◦ If msgsz is larger than maxmsz, error code is returned ◦ If not enough space, task issued this system call goes to wait state ◦ If tmout elapses before wait state releases, system call terminates and return error code ◦ When tmout = T_POL, if there’s enough space, error code return without entering wait state ◦ When tmout = T_FEVR, task continues to wait for buffer space become available

tk_recv_mbf : receive message buffer  INT msgsz = tk_rcv_mbf ( ID mbfid, VP msg, TMO tmout ) Return message size or error code - Parameter, error code : similar to tk_snd_mbf

tk_ref_mbf : get message buffer status  ER ercd = tk_ref_mbf ( ID mbfid, T_RMBF *pk_rmbf )  Pk_rmbf details : ◦ VP exinf :Extended information ◦ ID wtsk :Waiting task information ◦ ID stsk :Send task information ◦ INT msgsz :Size of the next message to be received (in bytes) ◦ INT frbufsz :Free bu ff er size (in bytes) ◦ INT maxmsz :Maximum message size (in bytes)

 Descriptions : ◦ Reference the status of message buffer ◦ If multiple tasks are waiting, return the ID of task at the head of queue ◦ If no task waiting, 0 is returned ◦ If there’s no message at the queue, msgsz = 0 is returned