Changeset ea7890e7 in mainline for kernel/generic/src/proc/scheduler.c


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/src/proc/scheduler.c

    rff3a34b rea7890e7  
    406406                                         */
    407407                                        spinlock_unlock(&THREAD->lock);
    408                                         delay(10);
     408                                        delay(HZ);
    409409                                        spinlock_lock(&THREAD->lock);
    410410                                        DEADLOCK_PROBE(p_joinwq,
     
    416416                                spinlock_unlock(&THREAD->join_wq.lock);
    417417                               
    418                                 THREAD->state = Undead;
     418                                THREAD->state = JoinMe;
    419419                                spinlock_unlock(&THREAD->lock);
    420420                        }
Note: See TracChangeset for help on using the changeset viewer.