hal_create_thread(3hal)

hal_create_thread3hal

Create a hal thread

Usage

int hal_create_thread(const char *name, unsigned long period, int uses_fp)

int hal_thread_delete(const char *name)

Arguments

name

The name of the thread

period

The interval, in nanoseconds, between iterations of the thread

uses_fp

Must be nonzero if a function which uses floating-point will be attached to this thread.

Overview

hal_create_thread establishes a realtime thread that will execute one or more HAL functions periodically.

All thread periods are rounded to integer multiples of the hardware timer period, and the timer period is based on the first thread created. Threads must be created in order, from the fastest to the slowest. HAL assigns decreasing priorities to threads that are created later, so creating them from fastest to slowest results in rate monotonic priority scheduling.

hal_delete_thread deletes a previously created thread.

Realtime considerations

Call only from realtime init code, not from other realtime or non-realtime code.

Return value

Returns a HAL status code.

Releases

2 releases since Debian 12 (Bookworm); the text changed 1 time.

  1. 12
  2. 13

From linuxcnc-uspace-dev 1:2.9.4-2+deb13u1 in Debian 13 (Trixie). Parsed by carta from the page's man source.