Networking sockets with the use of shared memory, Operating System

Assignment Help:

Q. Compare the utilization of networking sockets with the use of shared memory as a mechanism for communicating data between processes on a single computer. What are the merits of each method? When might each one be preferred?

Answer: Utilizing network sockets rather than shared memory for local communication has a number of advantages. The major advantage is that the socket programming interface features a rich set of synchronization features. A process can effortlessly determine when new data has arrived on a socket connection how much data is present and who sent it. Processes are able to block until new data arrives on a socket or they can request that a signal be delivered when data arrives. A socket as well manages separate connections. A process with a socket open for receive is able to accept multiple connections to that socket and will be told when new processes try to connect or when old processes drop their connections.

Shared memory provided none of these features. There is no means for a process to determine whether another process has delivered or else changed data in shared memory other than by going to look at the contents of that memory. It is unfeasible for a process to block and request a wakeup when shared memory is delivered as well as there is no standard mechanism for other processes to establish a shared memory link to an existing process.

Nevertheless shared memory has the advantage that it is extremely much faster than socket communications in many cases. When data is transmit over a socket it is typically copied from memory to memory multiple times. Shared memory updates necessitate no data copies- if one process updates a data structure in shared memory that update is instantaneously visible to all other processes sharing that memory. Sending or else receiving data over a socket requires that a kernel system service call be made to initiate the transfer but shared memory communication can be performed completely in user mode with no transfer of control required.

Socket communication is usually preferred when connection management is significant or when there is a requirement to synchronize the sender and receiver. For instance server processes will typically establish a listening socket to which clients can connect when they want to use that service. Once the socket is conventional individual requests are as well sent using the socket as a result that the server can easily determine when a new request arrives and who it arrived from. In some cases nevertheless shared memory is preferred. Shared memory is frequently a better solution when either large amounts of data are to be transferred or when two processes require random access to a large common data set. In this case nevertheless the communicating processes may still require an extra mechanism in addition to shared memory to achieve synchronization among them. The X Window System a graphical display environment for UNIX is a good illustration of this most graphic requests are sent over sockets however shared memory is offered as an additional transport in special cases where large bitmaps are to be displayed on the screen. In this situation a request to display the bitmap will still be sent over the socket however the bulk data of the bitmap itself will be sent via shared memory.


Related Discussions:- Networking sockets with the use of shared memory

Default domain controllers policy gpo, Question: (a) Distinguish betwee...

Question: (a) Distinguish between local and active directory Group Policy in Windows Server 2008? (b) Describe the three areas of account Policies that can be managed thro

Explain first fit allocation algorithm, Describe the following allocation a...

Describe the following allocation algorithms: a. First fit b. Best fit c. Worst fit   a. First-fit: search the list of available memory and all

Mark-sweep, The objects that a program can access directly are those object...

The objects that a program can access directly are those objects which are referenced by local vari-ables on the processor stack, or by any global/static variables that refer to ob

Is disk scheduling useful in a single-user environment, Is disk scheduling,...

Is disk scheduling, other than FCFS scheduling, useful in a single-user environment? Explain your answer. In a single-user environment, the I/O queue usually is blank. Requests

Compression regarding the file system in windows 2000, Write short note on ...

Write short note on compression regarding the file system in Windows 2000. NTFS is able to perform data compression on individual files or on all data files in a directory. To

Explain the real time operating system, Explain the Real Time Operating Sys...

Explain the Real Time Operating System A real-time operating system comprises definite, fixed time constraints. Processing should be done in the defined constraints, or the sys

Explain chaining to handle collision, Explain Chaining to Handle Collision ...

Explain Chaining to Handle Collision Chaining:  One easy scheme is to chain all collisions in lists attached to the suitable slot. This permits an unlimited number of collision

Define the main reason to encrypt a file, Define the Main reason to encrypt...

Define the Main reason to encrypt a file Major reason to encrypt a file is secure it for transmission.

What methods are used to monitor intrusion detection, Question : a) Wh...

Question : a) What do you understand by a Directory Structure? Support your answer with a diagram. b) Give an example how Access Lists and Groups are arranged to mode of

How memory utilization factor shall be computed, How Memory utilization fac...

How Memory utilization factor shall be computed  Memory utilization factor shall be defined as Memory in use/total memory connected

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd