[En-Nut-Discussion] Thread management (killing threads)

Nathan Moore nategoose at gmail.com
Tue Jul 7 15:07:17 CEST 2009


Memory management isn't the only problem if you are trying to kill threads
from other threads.All allocated resources are issues and each needs their
own special handling.  NutOS has no
idea which files to call _close on or which semaphores, mutexes, or whatever
to exit on behalf
of the thread.  It does have know about which events a thread may be waiting
on, though, but if
an event is part of a mutex or semaphore it doesn't know that the thread
needs to post that event
or do any other book keeping for the mutex or semaphore on behalf of that
thread.Another even crazier scenario is if an event, mutex, or semaphore
lives in the stack space of a thread --
that would be very tricky to deal with for any threads that might be waiting
on it.

Nathan


More information about the En-Nut-Discussion mailing list