CPU (processing time) manager session interface

Question

Why are thread operations not methods of the thread but methods of the CPU session?

Answer

This enables the CPU session to impose policies on thread operations. These policies are based on the session construction arguments. If thread operations would be provided as thread methods, Thread would need to consult its container object (its CPU session) about the authorization of each operation and, thereby, would introduce a circular dependency between CPU session and Thread.

Class Genode::Cpu_session::Thread_creation_failed

Inherits from

public Exception

Class Genode::Cpu_session

Public definitions

Enum

THREAD_NAME_LEN 32

Enum

PRIORITY_LIMIT 1

Enum

DEFAULT_PRIORITY 0

Public functions

cancel_blocking

Cancel a currently blocking operation

Argument
Thread_capability thread Thread to unblock

create_thread

Create a new thread

Argument
char * name Name for the thread
Return

Thread_capability Capability representing the new thread

first

Retrieve thread list of CPU session

Return

Thread_capability

The next() function returns an invalid capability if the specified thread does not exists or if it is the last one of the CPU session.

kill_thread

Kill an existing thread

Argument
Thread_capability thread Capability of the thread to kill

name

Return thread name

Arguments
Thread_capability thread Thread to query
char * name_dst Destination string buffer
size_t name_len Length of destination string buffer
Return

int 0 on success

next

Argument
Thread_capability curr
Return

Thread_capability

scale_priority

Translate generic priority value to kernel-specific priority levels

Argument
bool inverse Order of platform priorities, if true pf_prio_limit corresponds to the highest priority, otherwise it refers to the lowest priority.
Return

unsigned Platform-specific priority value

service_name

Return

char *

set_pager

Set paging capabilities for thread

Arguments
Thread_capability thread Thread to configure
Pager_capability  pager Capability used to propagate page faults
Return

int

start

Modify instruction and stack pointer of thread - start the thread

Arguments
Thread_capability thread Thread to start
addr_t ip Initial instruction pointer
addr_t sp Initial stack pointer
Return

int 0 on success

state

Return thread state

Arguments
Thread_capability thread Thread to spy on
Thread_state * state_dst Result
Return

int 0 on success