thread.getStats

Syntax thread.getStats (adrTable)

Params adrTable is the address of a table in which the stats will be placed.

Action Gets information about the current running threads.

Returns True.

Examples new (tableType, @temp.threads);thread.getStats (@temp.threads)

   » true

Notes Each thread gets its own sub-table. The name of each sub-table is "thread" plus the numeric id of the thread.

Each sub-table has a threadstats item, a comma-delimited string containing information about the thread. This is what each item in threadstats means:

1. The ID of the thread as shown in system.compiler.threads

2. The time when the thread was started (in system ticks).

3. The time when the thread is to be woken up (in system ticks). This field only has a non-nil value if some code executed by the thread called thread.sleepfor or a similar verb.

4. The time when the thread last got control of the CPU (in system ticks).

5. The time slice (in system ticks) after which the thread is supposed to give up control of the CPU again. The default value is 6 for oneshot threads and 4 for the agent thread.

6. The date/time (in system date/time format, i.e. a signed long) at which to wake up from sleep. This is only used by the agent thread.

7. A boolean specific to the agent thread that is actually no longer used anywhere.

8. A boolean indicating whether this thread has already been scheduled for execution by the kernel's process scheduler.

9. A boolean indicating whether this is a oneshot thread.

10. A boolean indicating whether this is the thread currently in control of the processor. Obviously, this is always the thread that called thread.getStats.

11. An integer that is only non-nil if the thread just called thread.callScript, thread.sleepFor, or thread.sleepTicks.

Some sub-tables also have a traceback list. If present, it contains a list for every frame on the UserTalk stack. Each list contains the current line number, current char number on that line, and script address associated with that frame. The line/char numbers correspond to the cursor positions that you will be taken to from the Go To pop-up menu of an Error Info window.

This verb was new in Frontier 6.2.

See Also thread.getCount

thread.getCurrentID

thread.getNthID

thread.getStackDump

Frontier.hashStats

tcp.getStats

Discuss