New (Daemon constructor): Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
m (→Syntax terms) |
||
Line 15: | Line 15: | ||
If set to <code>True</code>:<ul><li>The GTBL server table is set to the same size on the daemon as it is on the master thread.<li>The GTBLHASH and GTBLPCT parameters on the daemon thread are set to the same values as on the master thread.<li>Only unstructured globals (globals created by $setg or $getg) and Perm Global Images in the master thread GTBL are copied to the daemon (Global Foundsets/Lists, Global Screens, and any Temp Global items are <b><i>not</i></b> copied).</ul></td></tr> | If set to <code>True</code>:<ul><li>The GTBL server table is set to the same size on the daemon as it is on the master thread.<li>The GTBLHASH and GTBLPCT parameters on the daemon thread are set to the same values as on the master thread.<li>Only unstructured globals (globals created by $setg or $getg) and Perm Global Images in the master thread GTBL are copied to the daemon (Global Foundsets/Lists, Global Screens, and any Temp Global items are <b><i>not</i></b> copied).</ul></td></tr> | ||
<tr><th><var>Transactional</var></th> | <tr><th><var>Transactional</var></th> | ||
<td>An optional, but <var>[[Methods#Named parameters|NameRequired]]</var> parameter whose value is a <var>[[Boolean enumeration]]</var>.<ul><li>If set to <code>True</code>, the daemon is [[Daemon_class#Transactional_daemons|transactional]], with the master and daemon threads share a single updating transaction.<li>If set to <code>False</code>, the default, the daemon is non-transactional.</ul> | <td>An optional, but <var>[[Methods#Named parameters|NameRequired]]</var> parameter whose value is a <var>[[Boolean enumeration]]</var>.<ul><li>If set to <code>True</code>, the daemon is [[Daemon_class#Transactional_daemons|transactional]], with the master and daemon threads share a single updating transaction.<li>If set to <code>False</code>, the default, the daemon is non-transactional.</ul></td></tr> | ||
<tr><th><var>OpenAll</var></th> | |||
<td>An optional, but <var>[[Methods#Named parameters|NameRequired]]</var> parameter whose value is a <var>[[Boolean enumeration]]</var>. If set to <code>True</code>, the daemon thread opens all files and groups that are open on the master thread. The files and groups are opened with the same privileges as on the master thread. This parameter is new as of <var class="product">[[Sirius Mods|Sirius Mods]]</var> Version 8.1.</td></tr> | |||
</table> | </table> | ||
Revision as of 03:49, 21 May 2012
Create a new Daemon (Daemon class)
New creates a new Daemon object instance. It has two, optional, arguments.
Syntax
%daemon = [%(Daemon):]New[( [CopyGlobals= boolean], [Transactional= boolean], - [OpenAll= boolean])] Throws MaxDaemExceeded, NoFreeDaemons, DaemonLost
Syntax terms
%daemon | A previously defined Daemon object. |
---|---|
[%(Daemon):] | The optional class name in parentheses denotes a Constructor. See "Usage notes", below, for more information about invoking a Daemon Constructor. |
CopyGlobals | An optional, but NameRequired parameter whose value is a Boolean enumeration.
The default is
If set to True :
|
Transactional | An optional, but NameRequired parameter whose value is a Boolean enumeration.
|
OpenAll | An optional, but NameRequired parameter whose value is a Boolean enumeration. If set to True , the daemon thread opens all files and groups that are open on the master thread. The files and groups are opened with the same privileges as on the master thread. This parameter is new as of Sirius Mods Version 8.1. |
Exceptions
This subroutine can throw the following exceptions:
- NoFreeDaemons
- If there are no daemon threads available to service the object, a NoFreeDaemons exception is thrown. This exception will only be thrown in Sirius Mods Version 7.2 and later.
Usage notes
- As described in "Using New or other Constructors", New can be invoked with no object, with an explicit class name, or with an object variable in the class, even if that object is Null:
%daemon = new %daemon = %(Daemon):new %daemon = %daemon:new
- New not only creates a Daemon object in the user tables, but it also finds a free sdaemon thread and dedicates it to the issuing user. If no sdaemon threads are available, the request is cancelled.
- The number of daemons allowed per master thread is limited by the MAXDAEM system parameter, whose default value is 1.
- If you specify
CopyGlobals=True
, and if there is insufficient server space (say, if daemons start out with very big tables, except for GTBL, and the master has a very big GTBL), the daemon fails during initialization.