KnightOS icon indicating copy to clipboard operation
KnightOS copied to clipboard

Add kernel API for examining running threads.

Open Ivoah opened this issue 9 years ago • 5 comments

Ivoah avatar May 07 '15 19:05 Ivoah

There's already some stuff in place for examining individual threads, but not all of them.

;; getNextThreadID [Threading]
;;  Gets the next running thread's ID.
;; Inputs:
;;  B: Thread index (0 for first thread)
;; Outputs:
;;  A: Thread ID or 0xFF if no more threads
;;  B: Incremented
;; Notes:
;;  It would be silly to call this without interrupts disabled.
;;
;;  This will return your own thread at some point.

ddevault avatar May 07 '15 19:05 ddevault

Probably worth giving all of the current threading syscalls a review to make sure sufficient information is exposed and things that shouldn't be exposed are kept private.

ddevault avatar May 07 '15 19:05 ddevault

Is there a method to find the number of running threads?

Ivoah avatar Jul 23 '15 03:07 Ivoah

No, you should call getNextThreadID in a loop and count it yourself.

ddevault avatar Jul 23 '15 03:07 ddevault

Not that getNextThreadID exists, that will have to be written.

ddevault avatar Jul 23 '15 03:07 ddevault