setmemwindow.1m (2010 09)

s
setmemwindow(1M) setmemwindow(1M)
A memory window with WinId could not be found in the attempt to join a memory
window.
A memory window with the WinId was found in the attempt to create a memory
window.
The
-f option instructs setmemwindow to execute program whether the desired
memory window was set or not. Obviously, using this option there is no guarantee pro-
gram has been attached to the desired memory window and it is unclear in what memory
window it is running. Using this option is strongly discouraged.
-i WinId Specifies the desired memory window. WinId is a key to the desired memory window.
WinId is a user specified value and should be one of the values contained in the file
/etc/services.window
.
Applications extract the user key from
/etc/services.window
according to a unique
string contained in
/etc/services.window
, using the
getmemwindow command.
(See getmemwindow (1M) and services.window(4).)
The kernel tries to locate an existing window with WinId. If one is found, that window is
used. If no window with WinId is found, an unused entry is located and assigned to
WinId.
The value
0 for WinID is special. If specified, the process/program is placed into the
default global window instead of a unique window with ID WinId.
If WinID is unspecified, the process and its children will run in a private memory win-
dow, and no other processes in the system can attach to this memory window. This
memory window remains active until the process and its children terminate.
-j Join an existing window with ID WinId. The specified process attaches to an existing
memory window. If no entry exists the call fails.
-n If program is executed, the default behavior is to waitpid() (see the wait (2) manual
page) for the process to terminate. Specifying -n causes setmemwindow to exit after
forking the child (that will execute program).
-o Send the PID of the executed program to standard output. The message sent out is:
setmemwindow:pid=
dddd\n, where dddd is the decimal value of the PID.
-p pid | program [arg]...
Change the memory window for process pid, or start program in the specified memory
window. If program has arguments (arg ... ), they must also be specified.
If
-p is unspecified or the value of pid is 0, the calling process has its window ID
changed, and program is executed.
If a nonzero process pid is specified, only the window in that process is changed, and pro-
gram is ignored.
-v Execute in verbose (debug) mode.
Application Usage
Memory Windows helps alleviate the 1.75-gigabyte limitation on system-wide shared memory for 32-bit
applications by allowing cooperating applications to configure their own 1-gigabyte window of shared
resources.
The definition of a memory window is only available for 32-bit processes.
Note that memory windows allows the creation of more than 1.75 gigabytes of total system-wide shared
memory, but it does not extend how much shared memory a single process can create.
SHARED_MAGIC
executables are still limited to 1.75 gigabytes.
HP-UX ships memory windows disabled. To enable memory windows, the kernel tunable parameter,
max_mem_window, must be set to the desired number. max_mem_window represents the number of
memory windows beyond the global default window. Setting max_mem_window to 2, for example, would
produce a total of three memory windows, the default global window plus two user defined windows. Set-
ting max_mem_window to 0 leaves only the default or global memory window.
There are two new commands and one file introduced by memory windows:
setmemwindow, get-
memwindow, and /etc/services.window file.
2 Hewlett-Packard Company 2 HP-UX 11i Version 3: September 2010