summaryrefslogtreecommitdiff
path: root/kern/thread.h
AgeCommit message (Collapse)Author
2013-04-08kern/thread: rework thread state handlingRichard Braun
In order to implement synchronization primitives, the thread_sleep and thread_wakeup functions are changed so that a thread waiting for an event can be reliably awaken, without ever missing a wakeup request.
2013-04-08kern/thread: rework bootstrappingRichard Braun
Instead of using idler threads to provide thread context during bootstrap, use a fake "booter" thread. This makes the creation of idler threads easier because they're not (even partially) used while being initialized when interrupts occur.
2013-03-17kern/thread: document schedulingRichard Braun
2013-03-16kern/thread: rename and move the on_rq thread memberRichard Braun
Change the name for consistency, move it for better alignment.
2013-03-16kern/thread: scale thread weights on timer frequencyRichard Braun
This prevents switching from one round to the next (and in turn round balancing) happening too frequently (or infrequently) when the timer frequency is increased (or decreased).
2013-03-16kern/thread: make thread_schedule privateRichard Braun
2013-03-15kern/thread: remove the unused cpu thread memberRichard Braun
2013-03-11kern/thread: inter-processor load balancingRichard Braun
This change introduces per run queue balancer threads which regularly scan remote run queues to balance threads among processors, using a variant of the distributed weighted round-robin (DWRR) algorithm that directly uses GR3 instead of WRR as the local scheduling algorithm. In addition, the thread_wakeup function has been extended to dispatch threads on remote processors too. Note that real-time threads are not concerned by this modification.
2013-03-09kern/thread: add round tracking for time-sharing threadsRichard Braun
Now that there is per-thread work accounting, work scaling can occur less frequently. Tracking rounds allows directly reusing the work of a thread on insertion or removal.
2013-03-05kern/thread: rework time-sharing schedulingRichard Braun
This change adds a new time-shared run queue for expired threads. There is now per-thread work accounting, potential preemption when waking up threads, and no linear reset of the run queue when starting a new round. It also prepares the introduction of thread migration.
2013-03-03kern/thread: implement thread_sleep and thread_wakeupRichard Braun
For now, thread_wakeup can only wake up a thread on the same processor as the caller. This is needed to properly implement thread migration.
2013-03-02kern/thread: minor preemption refactoringRichard Braun
2013-02-28kern/thread: rename thread_current to thread_selfRichard Braun
This is best explained by mentioning that the kernel attempts to provide a threading API similar to POSIX threads.
2013-01-11kern/thread: improve processor-local schedulingRichard Braun
This change introduces scheduling classes, including support for real-time and time-sharing threads. The real-time class matches the requirements of the POSIX SCHED_FIFO and SCHED_RR policies. The time-sharing class makes use of a scheduling algorithm based on group ratio round-robin (GR3) to provide proportional fairness.
2012-12-30kern/thread: remove outdated TODO commentRichard Braun
2012-12-28kern/thread: make thread_current migration-safeRichard Braun
This change removes the current thread member from the run queues, and moves the responsibility of maintaining it to the architecture specific tcb module. For the x86 architecture, the TCB functions use a per-CPU pointer that can be read and set in a single instruction, making it interrupt-safe and thus migration-safe.
2012-12-28kern/thread: minor comment changes about migrationRichard Braun
2012-12-27kern/thread: migration control functionsRichard Braun
There is currently no thread migration, but some modules already need migration control calls so that they're still valid once migration is implemented.
2012-12-18kern/task: task creation and informationRichard Braun
2012-12-14kern/thread: tidy scheduler entry functionsRichard Braun
2012-12-12kern/thread: support multiprocessor schedulingRichard Braun
In practice, this merely means an idle thread now exists for each CPU, and threads can be preempted and rescheduled on each of them. There is currently no migration between processors.
2012-12-11kern/thread: statically allocate idle thread structuresRichard Braun
Preemption control is implemented using a thread-local counter. The global dummy thread structure must be replaced with per-CPU ones, which will be used later for the idle threads.
2012-12-10kern/thread: fix compiler barrier semanticsRichard Braun
Preemption control functions must obviously not be reordered by the compiler.
2012-12-10kern/spinlock: make spinlocks disable preemptionRichard Braun
2012-12-09kern/thread: add preemption control functionsRichard Braun
2012-11-19kern/thread: preliminary scheduling implementationRichard Braun
This change adds periodic timer interrupt reporting to the thread module, basic thread selection, and context switching. It currently only applies to the main processor. The x86/tcb module has been drastically simplified as a side effect.
2012-11-09Implement preliminary thread contextRichard Braun
Three new modules are added : - kern/task: Tasks are thread groups and resource containers for their threads. - kern/thread: The well known scheduling unit. - x86/tcb: The architecture specific thread control block. The kernel currently loads a single thread context on the main processor.