|
|||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
Class Summary | |
---|---|
IPCPackage | |
Utils | An internal class that provides utility methods common to IPC classes. |
Enum Summary | |
---|---|
IPCException.Errors |
Exception Summary | |
---|---|
IPCException | A problem occurred while trying to use an IPC mechanism. |
A package that supports interprocess communications.
In terms of speed and bandwith, named pipes appear to fall somewhere between sockets and shared memory.
The underlying mechanism may or may not directly use the file created by this class. On Linux, for example, the file is the actual named pipe --- a FIFO. On Windows, the file is the logical name for the named pipe. The actual name exists in a Windows specific namespace.
Semaphore
is the traditional synchronization primitive that allow processes to
signal each other. The CLIP implementation is an "n-ary" semaphore that also
a file for use in allowing processes to identify the semaphore.
CLIP semaphores appear to be the faster than the other primitives in terms of synchronization, but of course do not provide any data exchange beyond that.
SharedMemory
class is a more user-friendly implementation of the JRE
mechanism for accessing shared memory: RandomAccessFile
,
FileChannel
and MappedByteBuffer
.
Should the JRE classes end up using some other mechanism that is unstuitable for for IPC, the intention is to change the CLIP version so that it keeps supporting shared memory.
CLIP shared memory appears to have the greatest bandwidth of all the CLIP IPC mechanisms.
CLIP shared memory exploits the underlying JRE support for synchronization via file locking to provide synchronization. This implementation appears to be roughly equal to the speed of named pipes and sockets, but significantly slower than that provided by semaphores.
com.lts.ipc.socket
package is a collection of utilities for
use with regular JRE sockets. CLIP does not try to provide a replacement for
JRE sockets since they are good enough as is.
The idea is that all processes that use the same file name will be connected to the same mechanism. Two processes that both use "/foo/bar" as the name with the Semaphore class, for example, will be connected to the same semaphore.
The use of file names is functional as well as symbolic. On Linux and Windows, the name supplied is created and populated with the underlying name or handle that is used to access the primitive.
For example, on Windows the file name provided for a shared queue will contain the actual name that windows uses to identify the queue. For semaphores, the Windows file will contain an integer value that is passed to semaphore-related operations to identify the semaphore being operated on.
The manner in which files are used is similar to the way that shared memory operates.
com.lts.ipc.namedpipe.NamedPipe
,
Semaphore
,
SharedMemory
|
|||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |