Home
last modified time | relevance | path

Searched full:executor (Results 1 – 25 of 842) sorted by relevance

12345678910>>...34

/external/guava/guava-tests/benchmark/com/google/common/util/concurrent/
DExecutionListBenchmark.java33 import java.util.concurrent.Executor;
53 void add(Runnable runnable, Executor executor); in add() argument
64 @Override public void add(Runnable runnable, Executor executor) { in newExecutionList() argument
65 list.add(runnable, executor); in newExecutionList()
82 @Override public void add(Runnable runnable, Executor executor) { in newExecutionList() argument
83 list.add(runnable, executor); in newExecutionList()
100 @Override public void add(Runnable runnable, Executor executor) { in newExecutionList() argument
101 list.add(runnable, executor); in newExecutionList()
118 @Override public void add(Runnable runnable, Executor executor) {
119 list.add(runnable, executor);
[all …]
DMoreExecutorsDirectExecutorBenchmark.java31 import java.util.concurrent.Executor;
42 @Override Executor executor() { in executor() method
46 EXECUTOR { enumConstant
47 @Override Executor executor() { in executor() method
51 abstract Executor executor(); in executor() method in MoreExecutorsDirectExecutorBenchmark.Impl
55 Executor executor; field in MoreExecutorsDirectExecutorBenchmark
69 executor = impl.executor(); in before()
75 executor.execute(localRunnable); in before()
92 return executor; in measureSize()
96 final Executor executor = this.executor; in timeUncontendedExecute() local
[all …]
/external/grpc-grpc-java/core/src/test/java/io/grpc/internal/
DSerializingExecutorTest.java29 import java.util.concurrent.Executor;
37 private SerializingExecutor executor = new SerializingExecutor(singleExecutor); field in SerializingExecutorTest
55 class CoyExecutor implements Executor { in resumable()
68 executor = new SerializingExecutor(new CoyExecutor()); in resumable()
70 executor.execute(new AddToRuns(1)); in resumable()
76 executor.execute(new AddToRuns(2)); in resumable()
84 executor.execute(new AddToRuns(1)); in serial()
89 executor.execute(new AddToRuns(2)); in serial()
97 executor.execute(new AddToRuns(1)); in parallel()
98 executor.execute(new AddToRuns(2)); in parallel()
[all …]
DConnectivityStateManagerTest.java29 import java.util.concurrent.Executor;
44 private final FakeClock executor = new FakeClock(); field in ConnectivityStateManagerTest
66 }, executor.getScheduledExecutorService(), CONNECTING); in registerCallbackBeforeStateChanged()
68 assertEquals(0, executor.numPendingTasks()); in registerCallbackBeforeStateChanged()
70 // Make sure the callback is run in the executor in registerCallbackBeforeStateChanged()
72 assertEquals(1, executor.runDueTasks()); in registerCallbackBeforeStateChanged()
73 assertEquals(0, executor.numPendingTasks()); in registerCallbackBeforeStateChanged()
88 }, executor.getScheduledExecutorService(), IDLE); in registerCallbackAfterStateChanged()
90 // Make sure the callback is run in the executor in registerCallbackAfterStateChanged()
92 assertEquals(1, executor.runDueTasks()); in registerCallbackAfterStateChanged()
[all …]
DSerializeReentrantCallsDirectExecutorTest.java35 SerializeReentrantCallsDirectExecutor executor; field in SerializeReentrantCallsDirectExecutorTest
39 executor = new SerializeReentrantCallsDirectExecutor(); in setup()
44 executor.execute(new Runnable() { in reentrantCallsShouldBeSerialized()
47 executor.execute(new Runnable() { in reentrantCallsShouldBeSerialized()
50 executor.execute(new Runnable() { in reentrantCallsShouldBeSerialized()
58 executor.execute(new Runnable() { in reentrantCallsShouldBeSerialized()
76 executor.execute(new Runnable() { in exceptionShouldNotCancelQueuedTasks()
79 executor.execute(new Runnable() { in exceptionShouldNotCancelQueuedTasks()
86 executor.execute(new Runnable() { in exceptionShouldNotCancelQueuedTasks()
103 executor.execute(null); in executingNullShouldFail()
[all …]
/external/guava/guava/src/com/google/common/eventbus/
DAsyncEventBus.java24 import java.util.concurrent.Executor;
27 * An {@link EventBus} that takes the Executor of your choice and uses it to
35 private final Executor executor; field in AsyncEventBus
42 * Creates a new AsyncEventBus that will use {@code executor} to dispatch
46 * @param executor Executor to use to dispatch events. It is the caller's
47 * responsibility to shut down the executor after the last event has
50 public AsyncEventBus(String identifier, Executor executor) { in AsyncEventBus() argument
52 this.executor = checkNotNull(executor); in AsyncEventBus()
56 * Creates a new AsyncEventBus that will use {@code executor} to dispatch
59 * @param executor Executor to use to dispatch events. It is the caller's
[all …]
/external/python/cpython3/Lib/test/
Dtest_concurrent_futures.py114 self.executor = self.executor_type(
119 self.executor = self.executor_type(
125 self.executor.shutdown(wait=True)
126 self.executor = None
139 # Make sure that the executor is ready to do work before running the
141 futures = [self.executor.submit(time.sleep, 0.1)
207 futures = [self.executor.submit(get_init_status)
235 future = self.executor.submit(get_init_status)
237 # Perhaps the executor is already broken
242 # At some point, the executor should break
[all …]
/external/python/futures/
Dtest_futures.py142 self.executor = self.executor_type(max_workers=self.worker_count)
149 self.executor.shutdown(wait=True)
156 # Make sure that the executor is ready to do work before running the
158 futures = [self.executor.submit(time.sleep, 0.1)
175 self.executor.shutdown()
177 self.executor.submit,
195 fs = [self.executor.submit(time.sleep, 0.1) for _ in range(50)]
196 self.executor.shutdown()
206 self.executor.submit(mul, 21, 2)
207 self.executor.submit(mul, 6, 7)
[all …]
/external/guava/guava/src/com/google/common/util/concurrent/
DExecutionList.java22 import java.util.concurrent.Executor;
30 * <p>A list of listeners, each with an associated {@code Executor}, that
37 * <p>Exceptions thrown by a listener will be propagated up to the executor.
38 * Any exception thrown during {@code Executor.execute} (e.g., a {@code
52 * The runnable, executor pairs to execute. This acts as a stack threaded through the
64 * Adds the {@code Runnable} and accompanying {@code Executor} to the list of
81 public void add(Runnable runnable, Executor executor) { in add() argument
83 // Executor states that it throws NPE on null listener, so we propagate in add()
86 Preconditions.checkNotNull(executor, "Executor was null."); in add()
93 runnables = new RunnableExecutorPair(runnable, executor, runnables); in add()
[all …]
DSerializingExecutor.java23 import java.util.concurrent.Executor;
30 * Executor ensuring that all Runnables submitted are executed in order,
31 * using the provided Executor, and serially such that no two will ever
34 * TODO(user): The tasks are given to the underlying executor as a single
35 * task, which means the semantics of the executor may be changed, e.g. the
36 * executor may have an afterExecute method that runs after every task
46 final class SerializingExecutor implements Executor {
50 /** Underlying executor that all submitted Runnable objects are run on. */
51 private final Executor executor; field in SerializingExecutor
72 * Creates a SerializingExecutor, running tasks using {@code executor}.
[all …]
DMoreExecutors.java39 import java.util.concurrent.Executor;
57 * Factory and utility methods for {@link java.util.concurrent.Executor}, {@link
76 * @param executor the executor to modify to make sure it exits when the
78 * @param terminationTimeout how long to wait for the executor to
85 ThreadPoolExecutor executor, long terminationTimeout, TimeUnit timeUnit) { in getExitingExecutorService() argument
87 .getExitingExecutorService(executor, terminationTimeout, timeUnit); in getExitingExecutorService()
99 * @param executor the executor to modify to make sure it exits when the
101 * @param terminationTimeout how long to wait for the executor to
108 ScheduledThreadPoolExecutor executor, long terminationTimeout, TimeUnit timeUnit) { in getExitingScheduledExecutorService() argument
110 .getExitingScheduledExecutorService(executor, terminationTimeout, timeUnit); in getExitingScheduledExecutorService()
[all …]
DAbstractIdleService.java23 import java.util.concurrent.Executor;
31 * which run in a executor which by default uses a separate thread
50 MoreExecutors.renamingDecorator(executor(), threadNameSupplier)
65 MoreExecutors.renamingDecorator(executor(), threadNameSupplier)
90 * Returns the {@link Executor} that will be used to run this service.
91 * Subclasses may override this method to use a custom {@link Executor}, which
93 * priority. The returned executor's {@link Executor#execute(Runnable)
97 protected Executor executor() { in executor() method in AbstractIdleService
98 return new Executor() { in executor()
120 @Override public final void addListener(Listener listener, Executor executor) {
[all …]
/external/libchrome/mojo/public/java/bindings/src/org/chromium/mojo/bindings/
DExecutorFactory.java20 import java.util.concurrent.Executor;
35 * Implementation of the executor which uses a pair of {@link MessagePipeHandle} for signaling.
36 * The executor will wait asynchronously on one end of a {@link MessagePipeHandle} on the thread
38 * executor will queue the {@link Runnable} and write a message on the other end of the handle.
39 * This will wake up the executor which is waiting on the handle, which will then dequeue the
42 private static class PipedExecutor implements Executor, Callback {
93 * Close the handles. Should only be called on the executor thread.
134 * Execute the given |command| in the executor thread. This can be called on any thread.
136 * @see Executor#execute(Runnable)
141 // from the executor's thread. in execute()
[all …]
/external/guava/guava-tests/test/com/google/common/util/concurrent/
DMoreExecutorsTest.java65 import java.util.concurrent.Executor;
91 final ListeningExecutorService executor = newDirectExecutorService(); in testDirectExecutorServiceServiceInThreadExecution() local
113 Future<?> future = executor.submit(incrementTask); in testDirectExecutorServiceServiceInThreadExecution()
124 ListenableFuture<?> future = executor.submit(incrementTask); in testDirectExecutorServiceServiceInThreadExecution()
137 final ExecutorService executor = newDirectExecutorService(); in testDirectExecutorServiceInvokeAll() local
155 executor.invokeAll(Collections.nCopies(10, incrementTask)); in testDirectExecutorServiceInvokeAll()
168 final ExecutorService executor = newDirectExecutorService(); in testDirectExecutorServiceServiceTermination() local
180 Future<?> future = executor.submit(new Callable<Void>() { in testDirectExecutorServiceServiceTermination()
188 assertTrue(executor.isShutdown()); in testDirectExecutorServiceServiceTermination()
189 assertFalse(executor.isTerminated()); in testDirectExecutorServiceServiceTermination()
[all …]
/external/grpc-grpc-java/core/src/main/java/io/grpc/internal/
DHttp2Ping.java23 import java.util.concurrent.Executor;
51 * The registered callbacks and the executor used to invoke them.
53 @GuardedBy("this") private Map<PingCallback, Executor> callbacks
54 = new LinkedHashMap<PingCallback, Executor>();
91 * @param executor the executor to use
93 public void addCallback(final ClientTransport.PingCallback callback, Executor executor) { in addCallback() argument
97 callbacks.put(callback, executor); in addCallback()
104 doExecute(executor, runnable); in addCallback()
124 Map<ClientTransport.PingCallback, Executor> callbacks; in complete()
135 for (Map.Entry<ClientTransport.PingCallback, Executor> entry : callbacks.entrySet()) { in complete()
[all …]
DConnectivityStateManager.java24 import java.util.concurrent.Executor;
43 * <p>The {@code executor} must be one that can run RPC call listeners.
45 void notifyWhenStateChanged(Runnable callback, Executor executor, ConnectivityState source) { in notifyWhenStateChanged() argument
47 checkNotNull(executor, "executor"); in notifyWhenStateChanged()
50 Listener stateChangeListener = new Listener(callback, executor); in notifyWhenStateChanged()
70 // if run in direct executor, can cause ConcurrentModificationException. in gotoState()
92 final Executor executor; field in ConnectivityStateManager.Listener
94 Listener(Runnable callback, Executor executor) { in Listener() argument
96 this.executor = executor; in Listener()
100 executor.execute(callback); in runInExecutor()
DSerializingExecutor.java24 import java.util.concurrent.Executor;
31 * Executor ensuring that all {@link Runnable} tasks submitted are executed in order
32 * using the provided {@link Executor}, and serially such that no two will ever be
36 public final class SerializingExecutor implements Executor, Runnable {
61 /** Underlying executor that all submitted Runnable objects are run on. */
62 private final Executor executor; field in SerializingExecutor
70 * Creates a SerializingExecutor, running tasks using {@code executor}.
72 * @param executor Executor in which tasks should be run. Must not be null.
74 public SerializingExecutor(Executor executor) { in SerializingExecutor() argument
75 Preconditions.checkNotNull(executor, "'executor' must not be null."); in SerializingExecutor()
[all …]
/external/python/futures/docs/
Dindex.rst13 defined by the abstract :class:`Executor` class.
15 Executor Objects
18 :class:`Executor` is an abstract class that provides methods to execute calls
22 .. method:: Executor.submit(fn, *args, **kwargs)
29 with ThreadPoolExecutor(max_workers=1) as executor:
30 future = executor.submit(pow, 323, 1235)
33 .. method:: Executor.map(func, *iterables, timeout=None)
44 .. method:: Executor.shutdown(wait=True)
46 Signal the executor that it should free any resources that it is using when
48 :meth:`Executor.submit` and :meth:`Executor.map` made after shutdown will
[all …]
/external/python/cpython3/Doc/library/
Dconcurrent.futures.rst20 defined by the abstract :class:`Executor` class.
23 Executor Objects
26 .. class:: Executor
37 with ThreadPoolExecutor(max_workers=1) as executor:
38 future = executor.submit(pow, 323, 1235)
52 after *timeout* seconds from the original call to :meth:`Executor.map`.
72 Signal the executor that it should free any resources that it is using
74 :meth:`Executor.submit` and :meth:`Executor.map` made after shutdown will
79 executor have been freed. If *wait* is ``False`` then this method will
80 return immediately and the resources associated with the executor will be
[all …]
/external/grpc-grpc-java/okhttp/src/main/java/io/grpc/okhttp/
DAsyncFrameWriter.java39 private final SerializingExecutor executor; field in AsyncFrameWriter
44 TransportExceptionHandler transportExceptionHandler, SerializingExecutor executor) { in AsyncFrameWriter() argument
46 this.executor = executor; in AsyncFrameWriter()
53 * <p>should only be called by thread of executor.
64 executor.execute(new WriteRunnable() { in connectionPreface()
74 executor.execute(new WriteRunnable() { in ackSettings()
85 executor.execute(new WriteRunnable() { in pushPromise()
98 executor.execute(new WriteRunnable() { in flush()
113 executor.execute(new WriteRunnable() { in synStream()
124 executor.execute(new WriteRunnable() { in synReply()
[all …]
/external/grpc-grpc-java/netty/src/main/java/io/grpc/netty/
DSendPingCommand.java20 import java.util.concurrent.Executor;
27 private final Executor executor; field in SendPingCommand
29 SendPingCommand(PingCallback callback, Executor executor) { in SendPingCommand() argument
31 this.executor = executor; in SendPingCommand()
38 Executor executor() { in executor() method in SendPingCommand
39 return executor; in executor()
/external/python/cpython3/Lib/concurrent/futures/
Dthread.py72 executor = executor_reference()
73 if executor is not None:
74 executor._initializer_failed()
84 executor = executor_reference()
87 # - The executor that owns the worker has been collected OR
88 # - The executor that owns the worker has been shutdown.
89 if _shutdown or executor is None or executor._shutdown:
90 # Flag the executor as shutting down as early as possible if it
92 if executor is not None:
93 executor._shutdown = True
[all …]
/external/libchrome/base/android/javatests/src/org/chromium/base/
DAsyncTaskTest.java19 import java.util.concurrent.Executor;
62 Executor executor = new AsyncTask.ChromeThreadPoolExecutor(1, 1, 1, TimeUnit.SECONDS, in testChromeThreadPoolExecutorRunnables() local
70 executor.execute(new SpecialRunnable()); in testChromeThreadPoolExecutorRunnables()
77 new SpecialChromeAsyncTask().executeOnExecutor(executor); in testChromeThreadPoolExecutorRunnables()
87 Executor executor = new AsyncTask.ChromeThreadPoolExecutor(1, 1, 1, TimeUnit.SECONDS, in testChromeThreadPoolExecutorChromeAsyncTask() local
95 new SpecialChromeAsyncTask().executeOnExecutor(executor); in testChromeThreadPoolExecutorChromeAsyncTask()
101 new SpecialOsAsyncTask().executeOnExecutor(executor); in testChromeThreadPoolExecutorChromeAsyncTask()
111 Executor executor = new AsyncTask.ChromeThreadPoolExecutor(1, 1, 1, TimeUnit.SECONDS, in testChromeThreadPoolExecutorOsAsyncTask() local
119 new SpecialOsAsyncTask().executeOnExecutor(executor); in testChromeThreadPoolExecutorOsAsyncTask()
126 new SpecialChromeAsyncTask().executeOnExecutor(executor); in testChromeThreadPoolExecutorOsAsyncTask()
/external/guava/guava-tests/test/com/google/common/eventbus/
DAsyncEventBusTest.java24 import java.util.concurrent.Executor;
34 /** The executor we use to fake asynchronicity. */
35 private FakeExecutor executor; field in AsyncEventBusTest
40 executor = new FakeExecutor(); in setUp()
41 bus = new AsyncEventBus(executor); in setUp()
48 // We post the event, but our Executor will not deliver it until instructed. in testBasicDistribution()
55 // Now we find the task in our Executor and explicitly activate it. in testBasicDistribution()
56 List<Runnable> tasks = executor.getTasks(); in testBasicDistribution()
66 * An {@link Executor} wanna-be that simply records the tasks it's given.
67 * Arguably the Worst Executor Ever.
[all …]
/external/grpc-grpc/src/core/lib/iomgr/
Dexecutor.h52 /** Is the executor multi-threaded? */
58 /** Shutdown the executor, running all pending work as part of the call */
61 /** Enqueue the closure onto the executor. is_short is true if the closure is
76 // == Global executor functions ==
86 // default executor and the resolver executor.
88 // Some of the functions below operate on the DEFAULT executor only while some
102 // Get the DEFAULT executor scheduler for the given job_type
105 // Get the executor scheduler for a given executor_type and a job_type
109 // Return if a given executor is running in threaded mode (i.e if
110 // grpc_executor_set_threading(true) was called previously on that executor)
[all …]

12345678910>>...34