-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathpackage-info.java
executable file
·132 lines (131 loc) · 5.52 KB
/
package-info.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
/*******************************************************************************
* Copyright 2009, Clark N. Hobbie
*
* This file is part of the CLIPC library.
*
* The CLIPC library is free software; you can redistribute it and/or modify it
* under the terms of the Lesser GNU General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at
* your option) any later version.
*
* The CLIPC library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public
* License for more details.
*
* You should have received a copy of the Lesser GNU General Public License
* along with the CLIP library; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*******************************************************************************/
/**
* <P>
* A package that supports interprocess communications.
* </P>
*
* <H2>Table of Contents</H2>
* <UL>
* <LI><A href="#intro">Introduction</A></LI>
* <LI><A href="#named_pipe">Named Pipes</A></LI>
* <LI><A href="#semaphore">Semaphores</A></LI>
* <LI><A href="#shared_memory">Shared Memory</A></LI>
* <LI><A href="#socket">Sockets</A></LI>
* </UL>
*
* <A name="intro"><H2>Introduction</H2></A>
* This package documents the CLIP library (com.lts.ipc). CLIP provides support
* for communication primitives that do not exist in the JRE, such as semaphores
* and named pipes, or improve support for primitives that exist but may not be
* as clear, such as shared memory.
*
* <A name="named_pipe"><H2>Named Pipes</H2></A>
* Named Pipes also refer to FIFOs or Message Queues. In the context of CLIP, a
* named pipe is an one-way IPC mechanism that appears on the underlying file system.
*
* <P>
* In terms of speed and bandwith, named pipes appear to fall somewhere between
* sockets and shared memory.
* </P>
*
* <P>
* 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.
* </P>
*
* <A name="semaphore"><H2>Semaphores</H2></A>
* A CLIP {@link com.lts.ipc.semaphore.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.
*
* <P>
* 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.
* </P>
*
* <A name="shared_memory"><H2>Shared Memory</H2></A>
* The {@link com.lts.ipc.sharedmemory.SharedMemory}
* class is a more user-friendly implementation of the JRE
* mechanism for accessing shared memory: {@link java.io.RandomAccessFile},
* {@link java.nio.channels.FileChannel} and {@link java.nio.MappedByteBuffer}.
*
* <P>
* 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.
* </P>
*
* <P>
* CLIP shared memory appears to have the greatest bandwidth of all the CLIP
* IPC mechanisms.
* </P>
*
* <P>
* 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.
* </P>
*
* <A name="socket"><H2>Sockets</H2></A>
* The CLIP {@link 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.
*
* <A name="file_naming"><H2>File Naming</H2></A>
* CLIP uses files and file names to allow processes to identify instances of
* various IPC mechanisms that do not have a standard means for such identification
* across supported platforms. When creating an instance of Semaphore or
* NamedPipe, for example, the developer supplies a file name to identify it.
*
* <P>
* 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.
* </P>
*
* <P>
* 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.
* </P>
*
* <P>
* 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.
* </P>
*
* <P>
* The manner in which files are used is similar to the way that shared memory
* operates.
* </P>
*
* @see com.lts.ipc.namedpipe.NamedPipe
* @see com.lts.ipc.semaphore.Semaphore
* @see com.lts.ipc.sharedmemory.SharedMemory
*/
package com.lts.ipc;