- Operating System Tutorial
- OS - Home
- OS - Overview
- OS - Components
- OS - Types
- OS - Services
- OS - Properties
- OS - Processes
- OS - Process Scheduling
- OS - Scheduling algorithms
- OS - Multi-threading
- OS - Memory Management
- OS - Virtual Memory
- OS - I/O Hardware
- OS - I/O Software
- OS - File System
- OS - Security
- OS - Linux
- OS - Exams Questions with Answers
- OS - Exams Questions with Answers
- Operating System Useful Resources
- OS - Quick Guide
- OS - Useful Resources
- OS - Discussion
Local procedure calls in Windows
The message-passing facility in Windows is called the local procedure call (LPC) facility. LPC is used for communication between two processes on the same machine. It is similar to the standard remote procedure call (RPC) mechanism that is widely used, but it is optimized for and specific to Windows. Windows uses a port object to establish and maintain a connection between two processes, like Mach. Two types of ports are used by Windows: connection ports and communication ports.
The communication works as follows −
Server processes publish connection-port objects that are visible to all processes.
When a client wants services from a subsystem, it opens a handle to the server’s connection-port object and sends a connection request to that port. The server then creates a channel and returns a handle to the client.
The channel consists of a pair of private communication ports: one for client-server messages, the other for server-client messages. Communication channels also support a callback mechanism that allows the client and server to accept requests when they would normally be expecting a reply
When an LPC channel is created, one of three message-passing techniques is chosen −
For small messages (up to 256 bytes), the port’s message queue is used as intermediate storage, and the messages are copied from one process to the other.
For Larger messages, they must be passed through a section object, which is a region of shared memory associated with the channel.
An API is available that allows server processes to read and write directly into the address space of a client, the amount of data is too large to fit into a section object.
It is decided by client when it sets up the channel whether it will need to send a large message. If It is determined by client that it does want to send large messages, it asks for a section object to be created. Like that, if the server decides that replies will be large, then it will create a section object. Now to use the section object, a small message is sent that contains a pointer and size information about the section object. This method is more complicated than the first method listed above, but it avoids data copying. It is important to note that the LPC facility in Windows is not part of the Windows API and hence is not visible to the application programmer. Rather, applications which are using the Windows API invoke standard remote procedure calls. When the RPC is being invoked on a process on the same system, the RPC is handled indirectly through an LPC. procedure call. Additionally, many kernel services use LPC to communicate with client processes. The structure of local procedure calls in Windows is shown in below Figure &inus;
Figure: Local procedure calls in windows
- Related Articles
- System Calls in Unix and Windows
- What is Stack Allocation of Procedure Calls?
- Advanced local procedure call (ALPC)
- How can local variables be used in MySQL stored procedure?
- How to create a new local user in windows using PowerShell?
- Convert the specified Windows file time to an equivalent local time in C#
- How to delete the local group from the windows system using PowerShell?
- How to enable or disable local user on Windows OS using PowerShell?
- How to add users and groups to the local groups on Windows System using PowerShell?
- Timer in C++ using system calls
- Number of Recent Calls in Python
- HTTP REST API calls in ElectronJS
- What are system calls in Operating System?
- Different types of system calls