30
Group 1 Group 1 Members Members : SMU CSE : SMU CSE 8343 8343 Wael Faheem Wael Faheem Professor:Dr.M.KHALIL. Professor:Dr.M.KHALIL. Hazem Morsy Date:11- Hazem Morsy Date:11- 08-03 08-03 Poramate Ongsakorn Poramate Ongsakorn Payal H Patel Payal H Patel Samatha Devi Malka Samatha Devi Malka

Group 1 Members: SMU CSE 8343 Wael Faheem Professor:Dr.M.KHALIL. Hazem Morsy Date:11-08-03 Poramate Ongsakorn Payal H Patel Samatha Devi Malka

Embed Size (px)

Citation preview

Group 1Group 1

MembersMembers: SMU CSE 8343: SMU CSE 8343Wael Faheem Professor:Dr.M.KHALIL.Wael Faheem Professor:Dr.M.KHALIL.Hazem Morsy Date:11-08-03Hazem Morsy Date:11-08-03Poramate Ongsakorn Poramate Ongsakorn Payal H PatelPayal H PatelSamatha Devi Malka Samatha Devi Malka

INTERPROCESS INTERPROCESS COMMUNICATION IN A COMMUNICATION IN A

WINDOWS MULTIPROCESSOR WINDOWS MULTIPROCESSOR O.S VS SUN SOLARIS O.SO.S VS SUN SOLARIS O.S

BY:BY:

SAMATHA DEVI MALKASAMATHA DEVI MALKA

Outline:Outline:

IntroductionIntroduction Definition of IPCDefinition of IPC Types of IPCTypes of IPC Definition of UNIX/SUN SOLARIS O.SDefinition of UNIX/SUN SOLARIS O.S IPC Mechanisms for UNIXIPC Mechanisms for UNIX Definition of Windows O.SDefinition of Windows O.S IPC Mechanisms for WindowsIPC Mechanisms for Windows SynchronizationSynchronization Details of IPC MechanismsDetails of IPC Mechanisms Message QueuesMessage Queues Shared MemoryShared Memory PipesPipes ConclusionConclusion ReferencesReferences Thank youThank you

Introduction:Introduction:

In order to make a coherent system, In order to make a coherent system, processes usually have to pass information processes usually have to pass information back and forth, and that's where IPC back and forth, and that's where IPC comes in. comes in.

However, it turns out that the models of However, it turns out that the models of IPC available are very similar, in both IPC available are very similar, in both Windows Multiprocessor and Sun Solaris Windows Multiprocessor and Sun Solaris though the implementations differ greatly.though the implementations differ greatly.

Definition of IPC:Definition of IPC:

A set of programming interfaces that A set of programming interfaces that enables a process to communicate data or enables a process to communicate data or information to another process.information to another process.

Mechanisms for IPC exist in the different Mechanisms for IPC exist in the different layers of the system, from Mach layers of the system, from Mach messaging in the kernel to distributed messaging in the kernel to distributed notifications and Apple events in the notifications and Apple events in the application environments. application environments.

Types of IPC:Types of IPC:

IPC mechanisms include :-IPC mechanisms include :- pipes,pipes, named pipes, named pipes, signals, signals, message queueing, message queueing, semaphores, semaphores, shared memory, shared memory, sockets, sockets, the Clipboard, and the Clipboard, and application services.application services.

Outline:Outline:

IntroductionIntroduction Definition of IPCDefinition of IPC Types of IPCTypes of IPC Definition of UNIX/SUN SOLARIS O.SDefinition of UNIX/SUN SOLARIS O.S IPC Mechanisms for UNIXIPC Mechanisms for UNIX Definition of Windows O.SDefinition of Windows O.S IPC Mechanisms for WindowsIPC Mechanisms for Windows SynchronizationSynchronization Details of IPC MechanismsDetails of IPC Mechanisms Message QueuesMessage Queues Shared MemoryShared Memory PipesPipes ConclusionConclusion ReferencesReferences Thank youThank you

Definition of UNIX/SUN SOLARIS Definition of UNIX/SUN SOLARIS O.SO.S

UNIXUNIX: : is a multiuser, multitasking operating is a multiuser, multitasking operating system that is widely used as the master system that is widely used as the master control program in workstations and especially control program in workstations and especially servers. servers.

SolarisSolaris: Solaris is a multitasking, : Solaris is a multitasking, multiprocessing operating system and multiprocessing operating system and distributed computing environment for Sun's distributed computing environment for Sun's SPARC computers from SunSoft. It provides an SPARC computers from SunSoft. It provides an enterprise-wide UNIX environment enterprise-wide UNIX environment

IPC Mechanisms for UNIX:IPC Mechanisms for UNIX:

Shared memory, pipes, and message Shared memory, pipes, and message queues are all suitable for processes queues are all suitable for processes running on a running on a single computer.single computer.

sockets are usually the chosen techniquesockets are usually the chosen technique for communicating across the for communicating across the networknetwork..

Outline:Outline:

IntroductionIntroduction Definition of IPCDefinition of IPC Types of IPCTypes of IPC Definition of UNIX/SUN SOLARIS O.SDefinition of UNIX/SUN SOLARIS O.S IPC Mechanisms for UNIXIPC Mechanisms for UNIX Definition of Windows O.SDefinition of Windows O.S IPC Mechanisms for WindowsIPC Mechanisms for Windows SynchronizationSynchronization Details of IPC MechanismsDetails of IPC Mechanisms Message QueuesMessage Queues Shared MemoryShared Memory PipesPipes ConclusionConclusion ReferencesReferences Thank youThank you

Definition of Windows O.S:Definition of Windows O.S:

A family of operating systems for personal A family of operating systems for personal computers, Windows dominates the computers, Windows dominates the personal computer world.personal computer world.

Windows provides a graphical user Windows provides a graphical user interface (GUI), virtual memory interface (GUI), virtual memory management, multitasking, and support management, multitasking, and support for many peripheral devices. for many peripheral devices.

IPC Mechanisms for Windows:IPC Mechanisms for Windows:

Shared memory, pipes, and events Shared memory, pipes, and events (equivalent to signals).(equivalent to signals).

The clipboard/Dynamic Data Exchange (DDE), The clipboard/Dynamic Data Exchange (DDE), Component Object Model (COM), and send Component Object Model (COM), and send message. message.

Windows sockets and Message Queuing (also Windows sockets and Message Queuing (also known as MSMQ).known as MSMQ).

Remote procedure call (RPC) and mailslots.Remote procedure call (RPC) and mailslots.

Synchronization:Synchronization:

In serial data transmission, a method of In serial data transmission, a method of ensuring that the receiving end can ensuring that the receiving end can recognize characters in the order in which recognize characters in the order in which the transmitting end sent them, and can the transmitting end sent them, and can know where one character ends and the know where one character ends and the next begins. next begins.

Both UNIX and Windows have an extensive set of process and thread synchronization techniques.

Both operating systems use semaphores, which are synchronization primitives used to control access to a resource that can support a limited number of users.

Both UNIX and Windows also use mutex objects to control mutually exclusive access to a resource.

Outline:Outline:

IntroductionIntroduction Definition of IPCDefinition of IPC Types of IPCTypes of IPC Definition of UNIX/SUN SOLARIS O.SDefinition of UNIX/SUN SOLARIS O.S IPC Mechanisms for UNIXIPC Mechanisms for UNIX Definition of Windows O.SDefinition of Windows O.S IPC Mechanisms for WindowsIPC Mechanisms for Windows SynchronizationSynchronization Details of IPC MechanismsDetails of IPC Mechanisms Message QueuesMessage Queues Shared MemoryShared Memory PipesPipes ConclusionConclusion ReferencesReferences Thank youThank you

Details of Details of IPC MechanismsIPC Mechanisms

Message Queues(MQs):Message Queues(MQs):

In programming, message queueing is a In programming, message queueing is a method by which method by which processprocess (or program (or program instances) can exchange or pass data instances) can exchange or pass data using an interface to a system-managed using an interface to a system-managed queuequeue of messages. of messages.

MQs MQs IN UNIX:

One application sends messages to the queue; another application reads messages from the queue.

The queues are memory based and are very fast as a result.

Message queues were introduced in AT&T System V.2 UNIX.

MQs MQs IN Windows:

Messaging system is called Message Queuing (MSMQ).

Message Queuing provides guaranteed message delivery, efficient routing, security, and priority-based messaging.

In essence, a Message Queuing message is guaranteed to be delivered, but there is no specific guarantee about exactly when it will be received. The operation is the same as on UNIX

Shared Memory:Shared Memory:

Hardware architecture in which multiple Hardware architecture in which multiple processors operate independently but processors operate independently but share the same memory resources. share the same memory resources.

In computer programming, shared In computer programming, shared memory is a method by which program memory is a method by which program process can exchange data more quickly process can exchange data more quickly than by reading and writing using the than by reading and writing using the regularregular operating system services. operating system services.

Shared memory IN UNIX:

The program must first call a function to get a shared memory identifier, shm_id, for the amount of shared memory. The identifier is then used in calls to attach the shared memory to the process.

Shared memory in UNIX can be done based on the concept of file mapping.

Shared memory IN Windows:

Implementation of shared memory is based entirely on the concept of file mapping.

As in the UNIX implementation, which uses an identifier, Windows uses a handle identifier to identify the memory that is mapped into the process at the requested address.

Pipes:Pipes:

A pipe is a technique for passing information A pipe is a technique for passing information from one program process to another. Unlike from one program process to another. Unlike other forms of interprocess communication other forms of interprocess communication (IPC).(IPC).

A pipe is usually a one-way communication A pipe is usually a one-way communication only. only.

For two-way communication between For two-way communication between processes, two pipes can be set up, one for processes, two pipes can be set up, one for each direction. each direction.

Pipes in UNIX:

can be named or unnamed. They also have separate read and write file descriptors, which are created through a single function call. Two unrelated processes can use named pipes to communicate.

With unnamed pipes, a parent process that must communicate with a child process creates a pipe that the child process will inherit and use.

Pipes in Windows:

can also be named or unnamed. A parent process and a child process typically use unnamed pipes to communicate.

The processes must create two unnamed pipes for bidirectional communication

Two unrelated processes can use named pipes, even across the network on different computers.

Conclusion:Conclusion:

Like most everything else, IPC is not portable Like most everything else, IPC is not portable between Windows Multiprocessor OS and between Windows Multiprocessor OS and Sun Solaris OS. Sun Solaris OS.

However, though the implementation details However, though the implementation details differ greatly, the two systems do share differ greatly, the two systems do share certain ways of thinking about IPC. certain ways of thinking about IPC.

They try to cover the same functionality, and They try to cover the same functionality, and almost any style of IPC you implement in one almost any style of IPC you implement in one can usually be replicated in the other.can usually be replicated in the other.

References:References: [1] R.W. Stevens, Advanced Programming in the UNIX [1] R.W. Stevens, Advanced Programming in the UNIX

Environment, Addison-Wesley (Books)Environment, Addison-Wesley (Books)

[2] Robert Orfali and Dan Harkey, Client/Server Programming [2] Robert Orfali and Dan Harkey, Client/Server Programming with OS/2 2.0, Van Nostrand Reinhold. (Books)with OS/2 2.0, Van Nostrand Reinhold. (Books)

[3] A short introduction to operating systems, Mark Burgess, [3] A short introduction to operating systems, Mark Burgess, October 3, 2001October 3, 2001

http://www.iu.hio.no/%7Emark/os/os.htmlhttp://www.iu.hio.no/%7Emark/os/os.html (URL). (URL).

Definaitons: Definaitons: http://www.course.com/careers/glossary/operating.cfmhttp://www.course.com/careers/glossary/operating.cfm (URL) (URL)

UNIX: UNIX: http://http://www.course.com/careers/glossary/operating.cfm#unixwww.course.com/careers/glossary/operating.cfm#unix (URL)(URL)

IPC: IPC: iroi.seu.edu.cn/books/ee_dic/whatis/ipc.htm iroi.seu.edu.cn/books/ee_dic/whatis/ipc.htm (URL)(URL)

Pipes: Pipes: dictdie.net/pipes/dictdie.net/pipes/ (URL)(URL)

Any Questions ?Any Questions ?

THANK YOUTHANK YOU