a1 presentation 4 inter process comparisons revised

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

Upload: victorsrinivasa

Post on 10-Apr-2018

224 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A1 Presentation 4 Inter Process Comparisons Revised

8/8/2019 A1 Presentation 4 Inter Process Comparisons Revised

http://slidepdf.com/reader/full/a1-presentation-4-inter-process-comparisons-revised 1/30

Group 1Group 1

MembersMembers: SMU CSE 8343: SMU CSE 8343Wael Faheem Professor:Dr.M.KHALIL.Wael Faheem Professor:Dr.M.KHALIL.

Hazem Morsy Date:11Hazem Morsy Date:11--0808--0303Poramate OngsakornPoramate OngsakornPayal H PatelPayal H PatelSamatha Devi MalkaSamatha Devi Malka

Page 2: A1 Presentation 4 Inter Process Comparisons Revised

8/8/2019 A1 Presentation 4 Inter Process Comparisons Revised

http://slidepdf.com/reader/full/a1-presentation-4-inter-process-comparisons-revised 2/30

INTERPROCESS COMMUNICATIONINTERPROCESS COMMUNICATIONIN A WINDOWS MULTIPROCESSORIN A WINDOWS MULTIPROCESSOR

O.S VS SUN SOLARIS O.SO.S VS SUN SOLARIS O.S

BY:BY:

SAMATHA DEVI MALKASAMATHA DEVI MALKA

Page 3: A1 Presentation 4 Inter Process Comparisons Revised

8/8/2019 A1 Presentation 4 Inter Process Comparisons Revised

http://slidepdf.com/reader/full/a1-presentation-4-inter-process-comparisons-revised 3/30

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

Page 4: A1 Presentation 4 Inter Process Comparisons Revised

8/8/2019 A1 Presentation 4 Inter Process Comparisons Revised

http://slidepdf.com/reader/full/a1-presentation-4-inter-process-comparisons-revised 4/30

Introduction:Introduction:

In order to make a coherent system, processesIn order to make a coherent system, processesusually have to pass information back and forth,usually have to pass information back and forth,

and that's where IPC comes in.and that's where IPC comes in.

However, it turns out that the models of IPCHowever, it turns out that the models of IPCavailable are very similar, in both Windowsavailable are very similar, in both Windows

Multiprocessor and Sun Solaris though theMultiprocessor and Sun Solaris though theimplementations differ greatly.implementations differ greatly.

Page 5: A1 Presentation 4 Inter Process Comparisons Revised

8/8/2019 A1 Presentation 4 Inter Process Comparisons Revised

http://slidepdf.com/reader/full/a1-presentation-4-inter-process-comparisons-revised 5/30

Definition of IPC:Definition of IPC:

 A set of programming interfaces that enables a A set of programming interfaces that enables aprocess to communicate data or information toprocess to communicate data or information to

another process.another process.

Mechanisms for IPC exist in the different layersMechanisms for IPC exist in the different layers

of the system, from Mach messaging in theof the system, from Mach messaging in thekernel to distributed notifications and Applekernel to distributed notifications and Appleevents in the application environments.events in the application environments.

Page 6: A1 Presentation 4 Inter Process Comparisons Revised

8/8/2019 A1 Presentation 4 Inter Process Comparisons Revised

http://slidepdf.com/reader/full/a1-presentation-4-inter-process-comparisons-revised 6/30

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, andthe Clipboard, and

application services.application services.

Page 7: A1 Presentation 4 Inter Process Comparisons Revised

8/8/2019 A1 Presentation 4 Inter Process Comparisons Revised

http://slidepdf.com/reader/full/a1-presentation-4-inter-process-comparisons-revised 7/30

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

Page 8: A1 Presentation 4 Inter Process Comparisons Revised

8/8/2019 A1 Presentation 4 Inter Process Comparisons Revised

http://slidepdf.com/reader/full/a1-presentation-4-inter-process-comparisons-revised 8/30

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

UNIXUNIX:: is a multiuser, multitasking operatingis a multiuser, multitasking operatingsystem that is widely used as the master controlsystem that is widely used as the master control

program in workstations and especially servers.program in workstations and especially servers.

SolarisSolaris: Solaris is a multitasking,: Solaris is a multitasking,multiprocessing operating system andmultiprocessing operating system anddistributed computing environment for Sun'sdistributed computing environment for Sun'sSPARC computers from SunSoft. It provides anSPARC computers from SunSoft. It provides anenterpriseenterprise--wide UNIX environment wide UNIX environment 

Page 9: A1 Presentation 4 Inter Process Comparisons Revised

8/8/2019 A1 Presentation 4 Inter Process Comparisons Revised

http://slidepdf.com/reader/full/a1-presentation-4-inter-process-comparisons-revised 9/30

Page 10: A1 Presentation 4 Inter Process Comparisons Revised

8/8/2019 A1 Presentation 4 Inter Process Comparisons Revised

http://slidepdf.com/reader/full/a1-presentation-4-inter-process-comparisons-revised 10/30

IPC Mechanisms for UNIX:IPC Mechanisms for UNIX:

Shared memory, pipes, and message queues areShared memory, pipes, and message queues are

all suitable for processes running on aall suitable for processes running on a singlesinglecomputer.computer.

sockets are usually the chosen techniquesockets are usually the chosen technique forforcommunicating across thecommunicating across the networknetwork..

Page 11: A1 Presentation 4 Inter Process Comparisons Revised

8/8/2019 A1 Presentation 4 Inter Process Comparisons Revised

http://slidepdf.com/reader/full/a1-presentation-4-inter-process-comparisons-revised 11/30

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

Page 12: A1 Presentation 4 Inter Process Comparisons Revised

8/8/2019 A1 Presentation 4 Inter Process Comparisons Revised

http://slidepdf.com/reader/full/a1-presentation-4-inter-process-comparisons-revised 12/30

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

 A family of operating systems for personal A family of operating systems for personalcomputers, Windows dominates the personalcomputers, Windows dominates the personal

computer world.computer world.

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

Page 13: A1 Presentation 4 Inter Process Comparisons Revised

8/8/2019 A1 Presentation 4 Inter Process Comparisons Revised

http://slidepdf.com/reader/full/a1-presentation-4-inter-process-comparisons-revised 13/30

Page 14: A1 Presentation 4 Inter Process Comparisons Revised

8/8/2019 A1 Presentation 4 Inter Process Comparisons Revised

http://slidepdf.com/reader/full/a1-presentation-4-inter-process-comparisons-revised 14/30

IPC Mechanisms for Windows:IPC Mechanisms for Windows:

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

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

Windows sockets and Message Queuing (alsoWindows sockets and Message Queuing (alsoknown as MSMQ).known as MSMQ).

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

Page 15: A1 Presentation 4 Inter Process Comparisons Revised

8/8/2019 A1 Presentation 4 Inter Process Comparisons Revised

http://slidepdf.com/reader/full/a1-presentation-4-inter-process-comparisons-revised 15/30

Synchronization:Synchronization:

In serial data transmission, a method of In serial data transmission, a method of 

ensuring that the receiving end can recognizeensuring that the receiving end can recognizecharacters in the order in which the transmittingcharacters in the order in which the transmittingend sent them, and can know where oneend sent them, and can know where onecharacter ends and the next begins.character ends and the next begins.

Page 16: A1 Presentation 4 Inter Process Comparisons Revised

8/8/2019 A1 Presentation 4 Inter Process Comparisons Revised

http://slidepdf.com/reader/full/a1-presentation-4-inter-process-comparisons-revised 16/30

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 controlaccess to a resource that can support a limitednumber of users.

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

Page 17: A1 Presentation 4 Inter Process Comparisons Revised

8/8/2019 A1 Presentation 4 Inter Process Comparisons Revised

http://slidepdf.com/reader/full/a1-presentation-4-inter-process-comparisons-revised 17/30

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

Page 18: A1 Presentation 4 Inter Process Comparisons Revised

8/8/2019 A1 Presentation 4 Inter Process Comparisons Revised

http://slidepdf.com/reader/full/a1-presentation-4-inter-process-comparisons-revised 18/30

Details of Details of IPC MechanismsIPC Mechanisms

Page 19: A1 Presentation 4 Inter Process Comparisons Revised

8/8/2019 A1 Presentation 4 Inter Process Comparisons Revised

http://slidepdf.com/reader/full/a1-presentation-4-inter-process-comparisons-revised 19/30

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

In programming, message queueing is a methodIn programming, message queueing is a methodby whichby which processprocess (or program instances) can(or program instances) can

exchange or pass data using an interface to aexchange or pass data using an interface to asystemsystem--managedmanaged queuequeue of messages.of messages.

Page 20: A1 Presentation 4 Inter Process Comparisons Revised

8/8/2019 A1 Presentation 4 Inter Process Comparisons Revised

http://slidepdf.com/reader/full/a1-presentation-4-inter-process-comparisons-revised 20/30

MQsMQs IN UNIX:

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

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

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

Page 21: A1 Presentation 4 Inter Process Comparisons Revised

8/8/2019 A1 Presentation 4 Inter Process Comparisons Revised

http://slidepdf.com/reader/full/a1-presentation-4-inter-process-comparisons-revised 21/30

MQsMQs 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 specificguarantee about exactly when it will be received.The operation is the same as on UNIX 

Page 22: A1 Presentation 4 Inter Process Comparisons Revised

8/8/2019 A1 Presentation 4 Inter Process Comparisons Revised

http://slidepdf.com/reader/full/a1-presentation-4-inter-process-comparisons-revised 22/30

Shared Memory:Shared Memory:

Hardware architecture in which multipleHardware architecture in which multipleprocessors operate independently but share theprocessors operate independently but share the

same memory resources.same memory resources.

In computer programming, shared memory is aIn computer programming, shared memory is amethod by which program process can exchangemethod by which program process can exchangedata more quickly than by reading and writingdata more quickly than by reading and writing

using the regularusing the regular operating system services.operating system services.

Page 23: A1 Presentation 4 Inter Process Comparisons Revised

8/8/2019 A1 Presentation 4 Inter Process Comparisons Revised

http://slidepdf.com/reader/full/a1-presentation-4-inter-process-comparisons-revised 23/30

Shared memory IN UNIX:

The program must first call a function to get ashared memory identifier, shm_id, for theamount of shared memory. The identifier is

then used in calls to attach the shared memoryto the process.

Shared memory in UNIX can be done based on the

concept of file mapping.

Page 24: A1 Presentation 4 Inter Process Comparisons Revised

8/8/2019 A1 Presentation 4 Inter Process Comparisons Revised

http://slidepdf.com/reader/full/a1-presentation-4-inter-process-comparisons-revised 24/30

Shared memory IN Windows:

Implementation of shared memory is based

entirely on the concept of file mapping.

 As in the UNIX implementation, which uses anidentifier, Windows uses a handle identifier to

identify the memory that is mapped into theprocess at the requested address.

Page 25: A1 Presentation 4 Inter Process Comparisons Revised

8/8/2019 A1 Presentation 4 Inter Process Comparisons Revised

http://slidepdf.com/reader/full/a1-presentation-4-inter-process-comparisons-revised 25/30

Pipes:Pipes:

 A pipe is a technique for passing information A pipe is a technique for passing informationfrom one program process to another. Unlikefrom one program process to another. Unlike

other forms of interprocess communicationother forms of interprocess communication(IPC).(IPC).

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

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

Page 26: A1 Presentation 4 Inter Process Comparisons Revised

8/8/2019 A1 Presentation 4 Inter Process Comparisons Revised

http://slidepdf.com/reader/full/a1-presentation-4-inter-process-comparisons-revised 26/30

Pipes in UNIX:can be named or unnamed. They also haveseparate read and write file descriptors, which

are created through a single function call.

Two unrelated processes can use named pipes tocommunicate.

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

use.

Page 27: A1 Presentation 4 Inter Process Comparisons Revised

8/8/2019 A1 Presentation 4 Inter Process Comparisons Revised

http://slidepdf.com/reader/full/a1-presentation-4-inter-process-comparisons-revised 27/30

Pipes in Windows:

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

The processes must create two unnamed pipesfor bidirectional communication

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

Page 28: A1 Presentation 4 Inter Process Comparisons Revised

8/8/2019 A1 Presentation 4 Inter Process Comparisons Revised

http://slidepdf.com/reader/full/a1-presentation-4-inter-process-comparisons-revised 28/30

Conclusion:Conclusion:

Like most everything else, IPC is not portableLike most everything else, IPC is not portablebetween Windows Multiprocessor OS and Sunbetween Windows Multiprocessor OS and Sun

Solaris OS.Solaris OS. However, though the implementation detailsHowever, though the implementation details

differ greatly, the two systems do share certaindiffer greatly, the two systems do share certainways of thinking about IPC.ways of thinking about IPC.

They try to cover the same functionality, andThey try to cover the same functionality, andalmost any style of IPC you implement in onealmost any style of IPC you implement in onecan usually be replicated in the other.can usually be replicated in the other.

Page 29: A1 Presentation 4 Inter Process Comparisons Revised

8/8/2019 A1 Presentation 4 Inter Process Comparisons Revised

http://slidepdf.com/reader/full/a1-presentation-4-inter-process-comparisons-revised 29/30

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

 Addison Addison--Wesley (Books)Wesley (Books)

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

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

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://www.course.com/careers/glossary/operating.cfm#unixhttp://www.course.com/careers/glossary/operating.cfm#unix(URL)(URL)

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

Pipes:Pipes: dictdie.net/pipes/dictdie.net/pipes/URLURL

Page 30: A1 Presentation 4 Inter Process Comparisons Revised

8/8/2019 A1 Presentation 4 Inter Process Comparisons Revised

http://slidepdf.com/reader/full/a1-presentation-4-inter-process-comparisons-revised 30/30

 Any Questions ? Any Questions ?

THANK YOUTHANK YOU