Unit 'AmigaDOS' Package
[Overview][Constants][Types][Procedures and functions][Variables][Index] [#morphunits]

CreateNewProc

Create a new process from taglist

Declaration

Source position: amigados.pas line 1978

function CreateNewProc(

  tags: Pointer

):PProcess;

Arguments

tags

  

Information on the new process as tags (NP_*).

Description

You must specify one of NP_Seglist or NP_Entry. NP_Seglist takes a seglist (as returned by LoadSeg()). NP_Entry takes a function pointer for the routine to call.

There are many options, as you can see by examining dos/dostags.h. The defaults are for a non-CLI process, with copies of your CurrentDir, HomeDir (used for PROGDIR:), priority, consoletask, windowptr, and variables. The input and output filehandles default to opens of NIL:, stack to 4000, and others as shown in dostags.h. This is a fairly reasonable default setting for creating threads, though you may wish to modify it (for example, to give a descriptive name to the process.)

CreateNewProc() is callable from a task, though any actions that require doing Dos I/O (DupLock() of currentdir, for example) will not occur.

NOTE: if you call CreateNewProc() with both NP_Arguments, you must not specify an NP_Input of nil. When NP_Arguments is specified, it needs to modify the input filehandle to make ReadArgs() work properly.


Documentation generated on: 2021-07-30