2016-07-14 19:16:42 +03:00
|
|
|
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
2013-02-26 01:20:02 +04:00
|
|
|
# vim: set filetype=python:
|
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
|
2013-03-12 21:17:46 +04:00
|
|
|
XPIDL_SOURCES += [
|
|
|
|
'nsIEnvironment.idl',
|
|
|
|
'nsIEventTarget.idl',
|
2016-08-24 17:18:06 +03:00
|
|
|
'nsIIdlePeriod.idl',
|
2016-11-23 03:18:52 +03:00
|
|
|
'nsINamed.idl',
|
2013-03-12 21:17:46 +04:00
|
|
|
'nsIProcess.idl',
|
|
|
|
'nsIRunnable.idl',
|
2017-05-23 00:25:43 +03:00
|
|
|
'nsISerialEventTarget.idl',
|
2013-03-12 21:17:46 +04:00
|
|
|
'nsISupportsPriority.idl',
|
|
|
|
'nsIThread.idl',
|
|
|
|
'nsIThreadInternal.idl',
|
|
|
|
'nsIThreadManager.idl',
|
|
|
|
'nsIThreadPool.idl',
|
|
|
|
'nsITimer.idl',
|
|
|
|
]
|
|
|
|
|
2013-03-12 09:00:00 +04:00
|
|
|
XPIDL_MODULE = 'xpcom_threads'
|
|
|
|
|
2013-04-16 23:24:43 +04:00
|
|
|
EXPORTS += [
|
2017-01-20 22:13:57 +03:00
|
|
|
'MainThreadUtils.h',
|
2016-04-11 21:40:06 +03:00
|
|
|
'nsICancelableRunnable.h',
|
2017-05-16 18:18:33 +03:00
|
|
|
'nsIIdleRunnable.h',
|
2017-07-20 02:23:01 +03:00
|
|
|
'nsILabelableRunnable.h',
|
2013-07-09 06:15:34 +04:00
|
|
|
'nsMemoryPressure.h',
|
2013-04-16 23:24:43 +04:00
|
|
|
'nsProcess.h',
|
2017-01-20 22:13:57 +03:00
|
|
|
'nsProxyRelease.h',
|
2013-04-16 23:24:43 +04:00
|
|
|
'nsThread.h',
|
2017-01-20 22:13:57 +03:00
|
|
|
'nsThreadUtils.h',
|
2013-04-16 23:24:43 +04:00
|
|
|
]
|
|
|
|
|
|
|
|
EXPORTS.mozilla += [
|
Bug 1382922 - Refactor event queue to allow multiple implementations (r=erahm)
This patch refactors the nsThread event queue to clean it up and to make it easier to restructure. The fundamental concepts are as follows:
Each nsThread will have a pointer to a refcounted SynchronizedEventQueue. A SynchronizedEQ takes care of doing the locking and condition variable work when posting and popping events. For the actual storage of events, it delegates to an AbstractEventQueue data structure. It keeps a UniquePtr to the AbstractEventQueue that it uses for storage.
Both SynchronizedEQ and AbstractEventQueue are abstract classes. There is only one concrete implementation of SynchronizedEQ in this patch, which is called ThreadEventQueue. ThreadEventQueue uses locks and condition variables to post and pop events the same way nsThread does. It also encapsulates the functionality that DOM workers need to implement their special event loops (PushEventQueue and PopEventQueue). In later Quantum DOM work, I plan to have another SynchronizedEQ implementation for the main thread, called SchedulerEventQueue. It will have special code for the cooperatively scheduling threads in Quantum DOM.
There are two concrete implementations of AbstractEventQueue in this patch: EventQueue and PrioritizedEventQueue. EventQueue replaces the old nsEventQueue. The other AbstractEventQueue implementation is PrioritizedEventQueue, which uses multiple queues for different event priorities.
The final major piece here is ThreadEventTarget, which splits some of the code for posting events out of nsThread. Eventually, my plan is for multiple cooperatively scheduled nsThreads to be able to share a ThreadEventTarget. In this patch, though, each nsThread has its own ThreadEventTarget. The class's purpose is just to collect some related code together.
One final note: I tried to avoid virtual dispatch overhead as much as possible. Calls to SynchronizedEQ methods do use virtual dispatch, since I plan to use different implementations for different threads with Quantum DOM. But all the calls to EventQueue methods should be non-virtual. Although the methods are declared virtual, all the classes used are final and the concrete classes involved should all be known through templatization.
MozReview-Commit-ID: 9Evtr9oIJvx
2017-06-21 05:42:13 +03:00
|
|
|
'AbstractEventQueue.h',
|
2015-08-05 02:32:11 +03:00
|
|
|
'AbstractThread.h',
|
2017-01-20 22:13:57 +03:00
|
|
|
'BlockingResourceBase.h',
|
|
|
|
'CondVar.h',
|
|
|
|
'DeadlockDetector.h',
|
Bug 1382922 - Refactor event queue to allow multiple implementations (r=erahm)
This patch refactors the nsThread event queue to clean it up and to make it easier to restructure. The fundamental concepts are as follows:
Each nsThread will have a pointer to a refcounted SynchronizedEventQueue. A SynchronizedEQ takes care of doing the locking and condition variable work when posting and popping events. For the actual storage of events, it delegates to an AbstractEventQueue data structure. It keeps a UniquePtr to the AbstractEventQueue that it uses for storage.
Both SynchronizedEQ and AbstractEventQueue are abstract classes. There is only one concrete implementation of SynchronizedEQ in this patch, which is called ThreadEventQueue. ThreadEventQueue uses locks and condition variables to post and pop events the same way nsThread does. It also encapsulates the functionality that DOM workers need to implement their special event loops (PushEventQueue and PopEventQueue). In later Quantum DOM work, I plan to have another SynchronizedEQ implementation for the main thread, called SchedulerEventQueue. It will have special code for the cooperatively scheduling threads in Quantum DOM.
There are two concrete implementations of AbstractEventQueue in this patch: EventQueue and PrioritizedEventQueue. EventQueue replaces the old nsEventQueue. The other AbstractEventQueue implementation is PrioritizedEventQueue, which uses multiple queues for different event priorities.
The final major piece here is ThreadEventTarget, which splits some of the code for posting events out of nsThread. Eventually, my plan is for multiple cooperatively scheduled nsThreads to be able to share a ThreadEventTarget. In this patch, though, each nsThread has its own ThreadEventTarget. The class's purpose is just to collect some related code together.
One final note: I tried to avoid virtual dispatch overhead as much as possible. Calls to SynchronizedEQ methods do use virtual dispatch, since I plan to use different implementations for different threads with Quantum DOM. But all the calls to EventQueue methods should be non-virtual. Although the methods are declared virtual, all the classes used are final and the concrete classes involved should all be known through templatization.
MozReview-Commit-ID: 9Evtr9oIJvx
2017-06-21 05:42:13 +03:00
|
|
|
'EventQueue.h',
|
2015-03-10 04:41:24 +03:00
|
|
|
'HangAnnotations.h',
|
2013-04-16 23:24:43 +04:00
|
|
|
'HangMonitor.h',
|
2017-08-07 08:50:47 +03:00
|
|
|
'IdleTaskRunner.h',
|
2013-04-16 23:24:43 +04:00
|
|
|
'LazyIdleThread.h',
|
2016-08-24 17:18:06 +03:00
|
|
|
'MainThreadIdlePeriod.h',
|
2017-01-20 22:13:57 +03:00
|
|
|
'Monitor.h',
|
2015-08-14 21:31:34 +03:00
|
|
|
'MozPromise.h',
|
2017-01-20 22:13:57 +03:00
|
|
|
'Mutex.h',
|
Bug 1382922 - Refactor event queue to allow multiple implementations (r=erahm)
This patch refactors the nsThread event queue to clean it up and to make it easier to restructure. The fundamental concepts are as follows:
Each nsThread will have a pointer to a refcounted SynchronizedEventQueue. A SynchronizedEQ takes care of doing the locking and condition variable work when posting and popping events. For the actual storage of events, it delegates to an AbstractEventQueue data structure. It keeps a UniquePtr to the AbstractEventQueue that it uses for storage.
Both SynchronizedEQ and AbstractEventQueue are abstract classes. There is only one concrete implementation of SynchronizedEQ in this patch, which is called ThreadEventQueue. ThreadEventQueue uses locks and condition variables to post and pop events the same way nsThread does. It also encapsulates the functionality that DOM workers need to implement their special event loops (PushEventQueue and PopEventQueue). In later Quantum DOM work, I plan to have another SynchronizedEQ implementation for the main thread, called SchedulerEventQueue. It will have special code for the cooperatively scheduling threads in Quantum DOM.
There are two concrete implementations of AbstractEventQueue in this patch: EventQueue and PrioritizedEventQueue. EventQueue replaces the old nsEventQueue. The other AbstractEventQueue implementation is PrioritizedEventQueue, which uses multiple queues for different event priorities.
The final major piece here is ThreadEventTarget, which splits some of the code for posting events out of nsThread. Eventually, my plan is for multiple cooperatively scheduled nsThreads to be able to share a ThreadEventTarget. In this patch, though, each nsThread has its own ThreadEventTarget. The class's purpose is just to collect some related code together.
One final note: I tried to avoid virtual dispatch overhead as much as possible. Calls to SynchronizedEQ methods do use virtual dispatch, since I plan to use different implementations for different threads with Quantum DOM. But all the calls to EventQueue methods should be non-virtual. Although the methods are declared virtual, all the classes used are final and the concrete classes involved should all be known through templatization.
MozReview-Commit-ID: 9Evtr9oIJvx
2017-06-21 05:42:13 +03:00
|
|
|
'Queue.h',
|
2017-03-14 21:05:51 +03:00
|
|
|
'RecursiveMutex.h',
|
2017-01-20 22:13:57 +03:00
|
|
|
'ReentrantMonitor.h',
|
2017-05-23 04:26:26 +03:00
|
|
|
'RWLock.h',
|
2017-03-09 23:32:32 +03:00
|
|
|
'SchedulerGroup.h',
|
2015-08-04 00:37:23 +03:00
|
|
|
'SharedThreadPool.h',
|
2015-08-18 20:31:16 +03:00
|
|
|
'StateMirroring.h',
|
|
|
|
'StateWatching.h',
|
Bug 1382922 - Refactor event queue to allow multiple implementations (r=erahm)
This patch refactors the nsThread event queue to clean it up and to make it easier to restructure. The fundamental concepts are as follows:
Each nsThread will have a pointer to a refcounted SynchronizedEventQueue. A SynchronizedEQ takes care of doing the locking and condition variable work when posting and popping events. For the actual storage of events, it delegates to an AbstractEventQueue data structure. It keeps a UniquePtr to the AbstractEventQueue that it uses for storage.
Both SynchronizedEQ and AbstractEventQueue are abstract classes. There is only one concrete implementation of SynchronizedEQ in this patch, which is called ThreadEventQueue. ThreadEventQueue uses locks and condition variables to post and pop events the same way nsThread does. It also encapsulates the functionality that DOM workers need to implement their special event loops (PushEventQueue and PopEventQueue). In later Quantum DOM work, I plan to have another SynchronizedEQ implementation for the main thread, called SchedulerEventQueue. It will have special code for the cooperatively scheduling threads in Quantum DOM.
There are two concrete implementations of AbstractEventQueue in this patch: EventQueue and PrioritizedEventQueue. EventQueue replaces the old nsEventQueue. The other AbstractEventQueue implementation is PrioritizedEventQueue, which uses multiple queues for different event priorities.
The final major piece here is ThreadEventTarget, which splits some of the code for posting events out of nsThread. Eventually, my plan is for multiple cooperatively scheduled nsThreads to be able to share a ThreadEventTarget. In this patch, though, each nsThread has its own ThreadEventTarget. The class's purpose is just to collect some related code together.
One final note: I tried to avoid virtual dispatch overhead as much as possible. Calls to SynchronizedEQ methods do use virtual dispatch, since I plan to use different implementations for different threads with Quantum DOM. But all the calls to EventQueue methods should be non-virtual. Although the methods are declared virtual, all the classes used are final and the concrete classes involved should all be known through templatization.
MozReview-Commit-ID: 9Evtr9oIJvx
2017-06-21 05:42:13 +03:00
|
|
|
'SynchronizedEventQueue.h',
|
2013-04-16 23:24:43 +04:00
|
|
|
'SyncRunnable.h',
|
2017-01-19 03:53:36 +03:00
|
|
|
'SystemGroup.h',
|
2017-01-19 07:26:17 +03:00
|
|
|
'TaskCategory.h',
|
2015-08-05 02:32:11 +03:00
|
|
|
'TaskDispatcher.h',
|
2015-08-08 03:03:47 +03:00
|
|
|
'TaskQueue.h',
|
Bug 1382922 - Refactor event queue to allow multiple implementations (r=erahm)
This patch refactors the nsThread event queue to clean it up and to make it easier to restructure. The fundamental concepts are as follows:
Each nsThread will have a pointer to a refcounted SynchronizedEventQueue. A SynchronizedEQ takes care of doing the locking and condition variable work when posting and popping events. For the actual storage of events, it delegates to an AbstractEventQueue data structure. It keeps a UniquePtr to the AbstractEventQueue that it uses for storage.
Both SynchronizedEQ and AbstractEventQueue are abstract classes. There is only one concrete implementation of SynchronizedEQ in this patch, which is called ThreadEventQueue. ThreadEventQueue uses locks and condition variables to post and pop events the same way nsThread does. It also encapsulates the functionality that DOM workers need to implement their special event loops (PushEventQueue and PopEventQueue). In later Quantum DOM work, I plan to have another SynchronizedEQ implementation for the main thread, called SchedulerEventQueue. It will have special code for the cooperatively scheduling threads in Quantum DOM.
There are two concrete implementations of AbstractEventQueue in this patch: EventQueue and PrioritizedEventQueue. EventQueue replaces the old nsEventQueue. The other AbstractEventQueue implementation is PrioritizedEventQueue, which uses multiple queues for different event priorities.
The final major piece here is ThreadEventTarget, which splits some of the code for posting events out of nsThread. Eventually, my plan is for multiple cooperatively scheduled nsThreads to be able to share a ThreadEventTarget. In this patch, though, each nsThread has its own ThreadEventTarget. The class's purpose is just to collect some related code together.
One final note: I tried to avoid virtual dispatch overhead as much as possible. Calls to SynchronizedEQ methods do use virtual dispatch, since I plan to use different implementations for different threads with Quantum DOM. But all the calls to EventQueue methods should be non-virtual. Although the methods are declared virtual, all the classes used are final and the concrete classes involved should all be known through templatization.
MozReview-Commit-ID: 9Evtr9oIJvx
2017-06-21 05:42:13 +03:00
|
|
|
'ThreadEventQueue.h',
|
2016-11-07 23:30:17 +03:00
|
|
|
'ThrottledEventQueue.h',
|
2013-04-16 23:24:43 +04:00
|
|
|
]
|
|
|
|
|
2017-08-07 08:50:47 +03:00
|
|
|
SOURCES += [
|
|
|
|
'IdleTaskRunner.cpp',
|
|
|
|
]
|
|
|
|
|
2013-11-19 06:34:00 +04:00
|
|
|
UNIFIED_SOURCES += [
|
2015-08-05 02:32:11 +03:00
|
|
|
'AbstractThread.cpp',
|
2017-01-20 22:13:57 +03:00
|
|
|
'BlockingResourceBase.cpp',
|
Bug 1382922 - Refactor event queue to allow multiple implementations (r=erahm)
This patch refactors the nsThread event queue to clean it up and to make it easier to restructure. The fundamental concepts are as follows:
Each nsThread will have a pointer to a refcounted SynchronizedEventQueue. A SynchronizedEQ takes care of doing the locking and condition variable work when posting and popping events. For the actual storage of events, it delegates to an AbstractEventQueue data structure. It keeps a UniquePtr to the AbstractEventQueue that it uses for storage.
Both SynchronizedEQ and AbstractEventQueue are abstract classes. There is only one concrete implementation of SynchronizedEQ in this patch, which is called ThreadEventQueue. ThreadEventQueue uses locks and condition variables to post and pop events the same way nsThread does. It also encapsulates the functionality that DOM workers need to implement their special event loops (PushEventQueue and PopEventQueue). In later Quantum DOM work, I plan to have another SynchronizedEQ implementation for the main thread, called SchedulerEventQueue. It will have special code for the cooperatively scheduling threads in Quantum DOM.
There are two concrete implementations of AbstractEventQueue in this patch: EventQueue and PrioritizedEventQueue. EventQueue replaces the old nsEventQueue. The other AbstractEventQueue implementation is PrioritizedEventQueue, which uses multiple queues for different event priorities.
The final major piece here is ThreadEventTarget, which splits some of the code for posting events out of nsThread. Eventually, my plan is for multiple cooperatively scheduled nsThreads to be able to share a ThreadEventTarget. In this patch, though, each nsThread has its own ThreadEventTarget. The class's purpose is just to collect some related code together.
One final note: I tried to avoid virtual dispatch overhead as much as possible. Calls to SynchronizedEQ methods do use virtual dispatch, since I plan to use different implementations for different threads with Quantum DOM. But all the calls to EventQueue methods should be non-virtual. Although the methods are declared virtual, all the classes used are final and the concrete classes involved should all be known through templatization.
MozReview-Commit-ID: 9Evtr9oIJvx
2017-06-21 05:42:13 +03:00
|
|
|
'EventQueue.cpp',
|
2015-03-10 04:41:24 +03:00
|
|
|
'HangAnnotations.cpp',
|
2013-04-24 01:54:15 +04:00
|
|
|
'HangMonitor.cpp',
|
2017-03-21 10:44:12 +03:00
|
|
|
'InputEventStatistics.cpp',
|
2013-04-24 01:54:15 +04:00
|
|
|
'LazyIdleThread.cpp',
|
2016-08-24 17:18:06 +03:00
|
|
|
'MainThreadIdlePeriod.cpp',
|
2013-04-24 01:54:15 +04:00
|
|
|
'nsEnvironment.cpp',
|
2013-07-09 06:15:34 +04:00
|
|
|
'nsMemoryPressure.cpp',
|
2013-04-24 01:54:15 +04:00
|
|
|
'nsProcessCommon.cpp',
|
2017-01-20 22:13:57 +03:00
|
|
|
'nsProxyRelease.cpp',
|
2013-04-24 01:54:15 +04:00
|
|
|
'nsThread.cpp',
|
|
|
|
'nsThreadManager.cpp',
|
|
|
|
'nsThreadPool.cpp',
|
2017-01-20 22:13:57 +03:00
|
|
|
'nsThreadUtils.cpp',
|
2013-04-24 01:54:15 +04:00
|
|
|
'nsTimerImpl.cpp',
|
Bug 1382922 - Refactor event queue to allow multiple implementations (r=erahm)
This patch refactors the nsThread event queue to clean it up and to make it easier to restructure. The fundamental concepts are as follows:
Each nsThread will have a pointer to a refcounted SynchronizedEventQueue. A SynchronizedEQ takes care of doing the locking and condition variable work when posting and popping events. For the actual storage of events, it delegates to an AbstractEventQueue data structure. It keeps a UniquePtr to the AbstractEventQueue that it uses for storage.
Both SynchronizedEQ and AbstractEventQueue are abstract classes. There is only one concrete implementation of SynchronizedEQ in this patch, which is called ThreadEventQueue. ThreadEventQueue uses locks and condition variables to post and pop events the same way nsThread does. It also encapsulates the functionality that DOM workers need to implement their special event loops (PushEventQueue and PopEventQueue). In later Quantum DOM work, I plan to have another SynchronizedEQ implementation for the main thread, called SchedulerEventQueue. It will have special code for the cooperatively scheduling threads in Quantum DOM.
There are two concrete implementations of AbstractEventQueue in this patch: EventQueue and PrioritizedEventQueue. EventQueue replaces the old nsEventQueue. The other AbstractEventQueue implementation is PrioritizedEventQueue, which uses multiple queues for different event priorities.
The final major piece here is ThreadEventTarget, which splits some of the code for posting events out of nsThread. Eventually, my plan is for multiple cooperatively scheduled nsThreads to be able to share a ThreadEventTarget. In this patch, though, each nsThread has its own ThreadEventTarget. The class's purpose is just to collect some related code together.
One final note: I tried to avoid virtual dispatch overhead as much as possible. Calls to SynchronizedEQ methods do use virtual dispatch, since I plan to use different implementations for different threads with Quantum DOM. But all the calls to EventQueue methods should be non-virtual. Although the methods are declared virtual, all the classes used are final and the concrete classes involved should all be known through templatization.
MozReview-Commit-ID: 9Evtr9oIJvx
2017-06-21 05:42:13 +03:00
|
|
|
'PrioritizedEventQueue.cpp',
|
2017-03-14 21:05:51 +03:00
|
|
|
'RecursiveMutex.cpp',
|
2017-05-23 04:26:26 +03:00
|
|
|
'RWLock.cpp',
|
2017-03-09 23:32:32 +03:00
|
|
|
'SchedulerGroup.cpp',
|
2015-08-04 00:37:23 +03:00
|
|
|
'SharedThreadPool.cpp',
|
2017-08-21 23:26:14 +03:00
|
|
|
'SynchronizedEventQueue.cpp',
|
2017-01-19 03:53:36 +03:00
|
|
|
'SystemGroup.cpp',
|
2015-08-08 03:03:47 +03:00
|
|
|
'TaskQueue.cpp',
|
Bug 1382922 - Refactor event queue to allow multiple implementations (r=erahm)
This patch refactors the nsThread event queue to clean it up and to make it easier to restructure. The fundamental concepts are as follows:
Each nsThread will have a pointer to a refcounted SynchronizedEventQueue. A SynchronizedEQ takes care of doing the locking and condition variable work when posting and popping events. For the actual storage of events, it delegates to an AbstractEventQueue data structure. It keeps a UniquePtr to the AbstractEventQueue that it uses for storage.
Both SynchronizedEQ and AbstractEventQueue are abstract classes. There is only one concrete implementation of SynchronizedEQ in this patch, which is called ThreadEventQueue. ThreadEventQueue uses locks and condition variables to post and pop events the same way nsThread does. It also encapsulates the functionality that DOM workers need to implement their special event loops (PushEventQueue and PopEventQueue). In later Quantum DOM work, I plan to have another SynchronizedEQ implementation for the main thread, called SchedulerEventQueue. It will have special code for the cooperatively scheduling threads in Quantum DOM.
There are two concrete implementations of AbstractEventQueue in this patch: EventQueue and PrioritizedEventQueue. EventQueue replaces the old nsEventQueue. The other AbstractEventQueue implementation is PrioritizedEventQueue, which uses multiple queues for different event priorities.
The final major piece here is ThreadEventTarget, which splits some of the code for posting events out of nsThread. Eventually, my plan is for multiple cooperatively scheduled nsThreads to be able to share a ThreadEventTarget. In this patch, though, each nsThread has its own ThreadEventTarget. The class's purpose is just to collect some related code together.
One final note: I tried to avoid virtual dispatch overhead as much as possible. Calls to SynchronizedEQ methods do use virtual dispatch, since I plan to use different implementations for different threads with Quantum DOM. But all the calls to EventQueue methods should be non-virtual. Although the methods are declared virtual, all the classes used are final and the concrete classes involved should all be known through templatization.
MozReview-Commit-ID: 9Evtr9oIJvx
2017-06-21 05:42:13 +03:00
|
|
|
'ThreadEventQueue.cpp',
|
|
|
|
'ThreadEventTarget.cpp',
|
2016-11-07 23:30:17 +03:00
|
|
|
'ThrottledEventQueue.cpp',
|
2013-10-24 03:05:43 +04:00
|
|
|
'TimerThread.cpp',
|
2013-04-24 01:54:15 +04:00
|
|
|
]
|
|
|
|
|
2013-09-12 16:15:51 +04:00
|
|
|
LOCAL_INCLUDES += [
|
|
|
|
'../build',
|
2014-07-15 22:12:59 +04:00
|
|
|
'/caps',
|
2014-07-28 21:30:21 +04:00
|
|
|
'/tools/profiler',
|
2013-09-12 16:15:51 +04:00
|
|
|
]
|
2013-11-19 06:47:14 +04:00
|
|
|
|
2014-07-23 03:37:51 +04:00
|
|
|
FINAL_LIBRARY = 'xul'
|
2013-10-23 16:01:24 +04:00
|
|
|
|
|
|
|
include('/ipc/chromium/chromium-config.mozbuild')
|