gecko-dev/xpcom/threads
Jon Coppeard 3c711dbdfd Bug 1904782 - Part 2: Make TaskController select threads for tasks deterministically r=xpcom-reviewers,nika
This replaces TaskController::mThreadPoolCV with an individual condition
variable for each thread, and uses these to wake individual threads. The task
for each thread is assigned beforehand by setting mCurrentTask.

The counter mIdleThreadCount is used to quickly tell if there are any threads
free.

This splits TaskController::RunPoolThread to move the task selection part to
SelectTaskToRun. MaybeDispatchOneTask is called whenever there may be a new
task to dispatch (this runs from both the main thread and pool threads).

I tried to keep the same behaviour with mEffectiveTaskPriority but I don't
fully understand what this is being used for.

Differential Revision: https://phabricator.services.mozilla.com/D214958
2024-07-11 08:56:13 +00:00
..
AbstractThread.cpp
AbstractThread.h Bug 1877522 - [1/3] Drive-by cleanup: standardize header-inclusion dance r=xpcom-reviewers,barret 2024-03-20 01:30:13 +00:00
BlockingResourceBase.cpp
BlockingResourceBase.h
CPUUsageWatcher.cpp
CPUUsageWatcher.h
CondVar.h
DataMutex.h
DeadlockDetector.h
DelayedRunnable.cpp
DelayedRunnable.h
EventQueue.cpp
EventQueue.h Bug 1858080 - Add a missing include in EventQueue.h. CLOSED TREE 2023-10-10 20:57:35 +03:00
EventTargetCapability.h
IdlePeriodState.cpp Bug 1861848 - Let foreground content processes run idle tasks without consulting the parent process, r=farre,pbone 2023-11-20 12:46:33 +00:00
IdlePeriodState.h Bug 1861848 - Let foreground content processes run idle tasks without consulting the parent process, r=farre,pbone 2023-11-20 12:46:33 +00:00
IdleTaskRunner.cpp Bug 1868744 - If JS engine triggered a GC slice, don't trigger another too soon from CCGCScheduler, r=jonco 2023-12-07 12:34:33 +00:00
IdleTaskRunner.h Bug 1868744 - If JS engine triggered a GC slice, don't trigger another too soon from CCGCScheduler, r=jonco 2023-12-07 12:34:33 +00:00
InputTaskManager.cpp
InputTaskManager.h
LazyIdleThread.cpp Bug 1891664 - Have a grace timeout before shutting down excess idle threads. r=xpcom-reviewers,necko-reviewers,dom-storage-reviewers,nika,janv,jesup#!xpcom-reviewers 2024-06-01 09:05:53 +00:00
LazyIdleThread.h
LeakRefPtr.h
MainThreadIdlePeriod.cpp Bug 1870008 - make high rate mode handling dynamic, r=farre 2023-12-18 15:40:09 +00:00
MainThreadIdlePeriod.h
MainThreadUtils.h
Monitor.h
MozPromise.h Bug 1891541 - [2/2] enforce that MozPromise only accepts static strings r=xpcom-reviewers,media-playback-reviewers,padenot,emilio 2024-04-24 17:02:49 +00:00
Mutex.h Bug 1879692: typo: s/aquires/acquires/ in `Mutex.h` r=webgpu-reviewers,nical 2024-03-07 22:07:32 +00:00
Queue.h
RWLock.cpp
RWLock.h
RecursiveMutex.cpp
RecursiveMutex.h
ReentrantMonitor.h
SchedulerGroup.cpp Bug 1624819 - Remove TaskCategory and other quantum dom remnants. r=smaug,media-playback-reviewers,credential-management-reviewers,cookie-reviewers,places-reviewers,win-reviewers,valentin,mhowell,sgalich,alwu 2023-10-10 08:51:12 +00:00
SchedulerGroup.h Bug 1624819 - Remove TaskCategory and other quantum dom remnants. r=smaug,media-playback-reviewers,credential-management-reviewers,cookie-reviewers,places-reviewers,win-reviewers,valentin,mhowell,sgalich,alwu 2023-10-10 08:51:12 +00:00
SharedThreadPool.cpp
SharedThreadPool.h
SpinEventLoopUntil.h
StateMirroring.h Bug 1877522 - [1/3] Drive-by cleanup: standardize header-inclusion dance r=xpcom-reviewers,barret 2024-03-20 01:30:13 +00:00
StateWatching.h Bug 1877522 - [1/3] Drive-by cleanup: standardize header-inclusion dance r=xpcom-reviewers,barret 2024-03-20 01:30:13 +00:00
StaticString.h Bug 1891541 - [2/2] enforce that MozPromise only accepts static strings r=xpcom-reviewers,media-playback-reviewers,padenot,emilio 2024-04-24 17:02:49 +00:00
SyncRunnable.h
SynchronizedEventQueue.cpp
SynchronizedEventQueue.h
TaskController.cpp Bug 1904782 - Part 2: Make TaskController select threads for tasks deterministically r=xpcom-reviewers,nika 2024-07-11 08:56:13 +00:00
TaskController.h Bug 1904782 - Part 2: Make TaskController select threads for tasks deterministically r=xpcom-reviewers,nika 2024-07-11 08:56:13 +00:00
TaskDispatcher.h Bug 1877522 - [1/3] Drive-by cleanup: standardize header-inclusion dance r=xpcom-reviewers,barret 2024-03-20 01:30:13 +00:00
TaskQueue.cpp
TaskQueue.h
ThreadBound.h
ThreadDelay.cpp
ThreadDelay.h
ThreadEventQueue.cpp
ThreadEventQueue.h
ThreadEventTarget.cpp Bug 1856087 - Bypass assertion if NS_DISPATCH_IGNORE_BLOCK_DISPATCH is set, r=xpcom-reviewers,jstutte 2023-10-06 20:57:58 +00:00
ThreadEventTarget.h
ThreadLocalVariables.cpp
ThrottledEventQueue.cpp
ThrottledEventQueue.h
TimerThread.cpp Bug 1826224: Enable high-precision timers on Windows for foreground processes when not on battery power r=smaug 2023-10-31 14:34:39 +00:00
TimerThread.h Bug 1826224: Enable high-precision timers on Windows for foreground processes when not on battery power r=smaug 2023-10-31 14:34:39 +00:00
VsyncTaskManager.cpp
VsyncTaskManager.h
WinHandleWatcher.cpp Bug 1837079 - [8/10] Implement file-dialog utility-process-crash tests r=handyman,ipc-reviewers,mstange,gerard-majax,nika,profiler-reviewers,julienw 2023-10-26 18:21:30 +00:00
WinHandleWatcher.h Bug 1837079 - [8/10] Implement file-dialog utility-process-crash tests r=handyman,ipc-reviewers,mstange,gerard-majax,nika,profiler-reviewers,julienw 2023-10-26 18:21:30 +00:00
components.conf
moz.build Bug 1891541 - [2/2] enforce that MozPromise only accepts static strings r=xpcom-reviewers,media-playback-reviewers,padenot,emilio 2024-04-24 17:02:49 +00:00
nsEnvironment.cpp
nsEnvironment.h
nsICancelableRunnable.h
nsIDirectTaskDispatcher.idl Bug 1881863 - Part 1: Standardize on boolean over bool in xpidl, r=xpcom-reviewers,necko-reviewers,valentin,extension-reviewers,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,search-reviewers,anti-tracking-reviewers,places-reviewers,nalexander,emilio,zombie,sgalich,karlt,lina,Standard8 2024-04-04 18:45:21 +00:00
nsIDiscardableRunnable.h
nsIEnvironment.idl
nsIEventTarget.idl
nsIIdlePeriod.idl
nsIIdleRunnable.h
nsINamed.idl
nsIProcess.idl
nsIRunnable.idl
nsISerialEventTarget.idl
nsISupportsPriority.idl
nsITargetShutdownTask.h
nsIThread.idl
nsIThreadInternal.idl Bug 1873386 - Interfaces referenced from scriptable members need to be [scriptable] r=necko-reviewers,jschanck,mccr8,valentin 2024-04-09 11:29:22 +00:00
nsIThreadManager.idl Bug 1892481 - More consistently enforce noscript and builtinclass in xpidl, r=xpcom-reviewers,necko-reviewers,valentin,media-playback-reviewers,mccr8,padenot 2024-04-22 18:19:58 +00:00
nsIThreadPool.idl Bug 1891664 - Have a grace timeout before shutting down excess idle threads. r=xpcom-reviewers,necko-reviewers,dom-storage-reviewers,nika,janv,jesup#!xpcom-reviewers 2024-06-01 09:05:53 +00:00
nsIThreadShutdown.idl
nsITimer.idl
nsMemoryPressure.cpp
nsMemoryPressure.h
nsProcess.h
nsProcessCommon.cpp Bug 1858279 - Prelude: change Unix LaunchApp to take LaunchOptions by move. r=nika 2023-12-02 01:49:58 +00:00
nsProxyRelease.cpp
nsProxyRelease.h Bug 1858842 - Fix nsMainThreadPtrHolder's destructor during shutdown. r=xpcom-reviewers,mccr8 2023-10-17 11:23:13 +00:00
nsThread.cpp Bug 1895081 - Add extra assertions to nsThread initialization, r=xpcom-reviewers,jstutte 2024-06-04 18:36:18 +00:00
nsThread.h Bug 1862556: Allow LongTask markers to be generated for any nsThread r=nika 2023-12-07 04:15:44 +00:00
nsThreadManager.cpp Bug 1895438 - Do not add NS_DISPATCH_AT_END in BackgroundEventTarget::Dispatch. r=xpcom-reviewers,nika 2024-06-04 07:20:11 +00:00
nsThreadManager.h Bug 1862556: Allow LongTask markers to be generated for any nsThread r=nika 2023-12-07 04:15:44 +00:00
nsThreadPool.cpp Bug 1891664 - Have a grace timeout before shutting down excess idle threads. r=xpcom-reviewers,necko-reviewers,dom-storage-reviewers,nika,janv,jesup#!xpcom-reviewers 2024-06-01 09:05:53 +00:00
nsThreadPool.h Bug 1891664 - Have a grace timeout before shutting down excess idle threads. r=xpcom-reviewers,necko-reviewers,dom-storage-reviewers,nika,janv,jesup#!xpcom-reviewers 2024-06-01 09:05:53 +00:00
nsThreadSyncDispatch.h
nsThreadUtils.cpp
nsThreadUtils.h Bug 1880192 - [4/5] Remove IsRefcountedSmartPointer r=xpcom-reviewers,nika 2024-03-05 17:22:22 +00:00
nsTimerImpl.cpp
nsTimerImpl.h