Changeset ea7890e7 in mainline for kernel/generic/include/proc/task.h


Ignore:
Timestamp:
2007-06-01T15:47:46Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
07be3c4
Parents:
ff3a34b
Message:

More efficient and simpler task termination.

Based on the assumption, that after its creation, only the task itself can create more threads for itself,
the last thread with userspace context to execute thread_exit() will perform futex and IPC cleanup. When
the task has no threads, it is destroyed. Both the cleanup and destruction is controlled by reference
counting.

As for userspace threads, even though there could be a global garbage collector for joining threads, it is
much simpler if the uinit thread detaches itself before switching to userspace.

task_kill() is now an idempotent operation. It just instructs the threads within a task to exit.

Change in the name of a thread state: Undead → JoinMe.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/proc/task.h

    rff3a34b rea7890e7  
    6565       
    6666        char *name;
    67         /** Pointer to the main thread. */
    68         struct thread *main_thread;
    6967        /** List of threads contained in this task. */
    7068        link_t th_head;
     
    7674        context_id_t context;   
    7775
    78         /** If this is true, new threads can become part of the task. */
    79         bool accept_new_threads;
    8076        /** Number of references (i.e. threads). */
    81         count_t refcount;       
     77        atomic_t refcount;
     78        /** Number of threads that haven't exited yet. */
     79        atomic_t lifecount;
    8280
    8381        /** Task capabilities. */
     
    123121extern cap_t cap_get(task_t *t);
    124122
    125 
    126123#ifndef task_create_arch
    127124extern void task_create_arch(task_t *t);
Note: See TracChangeset for help on using the changeset viewer.