New (Daemon constructor): Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
m (match syntax table to syntax template, tags and edits) |
||
Line 1: | Line 1: | ||
{{Template:Daemon:New subtitle}} | {{Template:Daemon:New subtitle}} | ||
<var>New</var> creates a new <var>[[Daemon class|Daemon]]</var> object instance. It has two, optional, arguments. | |||
New | |||
==Syntax== | ==Syntax== | ||
Line 9: | Line 6: | ||
===Syntax terms=== | ===Syntax terms=== | ||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
<tr><th>% | <tr><th>%daemon</th> | ||
<td>A previously defined Daemon object. </td></tr> | <td>A previously defined <var>[[Daemon class|Daemon]]</var> object. </td></tr> | ||
<tr><th>CopyGlobals | <tr><th>CopyGlobals</th> | ||
<td>An optional, NameRequired parameter whose value is a Boolean enumeration | <td>An optional, but <var>[[Methods#Named parameters|NameRequired]]</var> parameter whose value is a <var>[[Boolean enumeration]]</var>. | ||
The default is < | The default is <code>False</code>: do not copy the existing global variable information from the master thread; use default GTBL-creation settings for the daemon. | ||
If set to < | 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>Transactional | <tr><th>Transactional</th> | ||
<td>An optional, NameRequired parameter whose value is a Boolean enumeration | <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> | ||
This parameter is new as of | This parameter is new as of <var class="product">[[Sirius Mods|"Sirius Mods"]]</var> Version 6.8.</td></tr> | ||
</table> | </table> | ||
==Exceptions== | ==Exceptions== | ||
This subroutine can throw the following exceptions:<dl> | This subroutine can throw the following exceptions:<dl> | ||
<dt><var>[[NoFreeDaemons_class|NoFreeDaemons]]</var> | |||
<dt>NoFreeDaemons | <dd>If there are no daemon threads available to service the object, a <var>NoFreeDaemons</var> exception is thrown. This exception will only be thrown in <var class="product">[[Sirius Mods|"Sirius Mods"]]</var> Version 7.2 and later.</dl> | ||
<dd>If there are no daemon threads available to service the object, a | |||
==Usage notes== | ==Usage notes== | ||
<ul> | <ul><li><var>New</var> 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. | ||
<li>The number of daemons allowed per master thread is limited by the <var>[[MAXDAEM parameter|MAXDAEM]]</var> system parameter, whose default value is 1. | |||
<li> | <li>If you specify <code>CopyGlobals=True</code>, 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. | ||
<li>The number of daemons allowed per master thread is limited by the MAXDAEM system parameter, whose default value is 1. | </ul> | ||
<li>If you specify < | |||
==See also== | ==See also== | ||
{{Template:Daemon:New footer}} | {{Template:Daemon:New footer}} |
Revision as of 02:11, 14 March 2011
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. |
---|---|
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.
|
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
- 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.