Share via


ThreadPoolExecutor Constructors

Definition

Overloads

ThreadPoolExecutor(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

ThreadPoolExecutor(Int32, Int32, Int64, TimeUnit, IBlockingQueue)

Creates a new ThreadPoolExecutor with the given initial parameters, the Executors#defaultThreadFactory default thread factory and the ThreadPoolExecutor.

ThreadPoolExecutor(Int32, Int32, Int64, TimeUnit, IBlockingQueue, IRejectedExecutionHandler)

Creates a new ThreadPoolExecutor with the given initial parameters and the Executors#defaultThreadFactory default thread factory.

ThreadPoolExecutor(Int32, Int32, Int64, TimeUnit, IBlockingQueue, IThreadFactory)

Creates a new ThreadPoolExecutor with the given initial parameters and the ThreadPoolExecutor.

ThreadPoolExecutor(Int32, Int32, Int64, TimeUnit, IBlockingQueue, IThreadFactory, IRejectedExecutionHandler)

Creates a new ThreadPoolExecutor with the given initial parameters.

ThreadPoolExecutor(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

protected ThreadPoolExecutor (IntPtr javaReference, Android.Runtime.JniHandleOwnership transfer);
new Java.Util.Concurrent.ThreadPoolExecutor : nativeint * Android.Runtime.JniHandleOwnership -> Java.Util.Concurrent.ThreadPoolExecutor

Parameters

javaReference
IntPtr

nativeint

A IntPtrcontaining a Java Native Interface (JNI) object reference.

transfer
JniHandleOwnership

A JniHandleOwnershipindicating how to handle javaReference

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

ThreadPoolExecutor(Int32, Int32, Int64, TimeUnit, IBlockingQueue)

Creates a new ThreadPoolExecutor with the given initial parameters, the Executors#defaultThreadFactory default thread factory and the ThreadPoolExecutor.

[Android.Runtime.Register(".ctor", "(IIJLjava/util/concurrent/TimeUnit;Ljava/util/concurrent/BlockingQueue;)V", "")]
public ThreadPoolExecutor (int corePoolSize, int maximumPoolSize, long keepAliveTime, Java.Util.Concurrent.TimeUnit? unit, Java.Util.Concurrent.IBlockingQueue? workQueue);
[<Android.Runtime.Register(".ctor", "(IIJLjava/util/concurrent/TimeUnit;Ljava/util/concurrent/BlockingQueue;)V", "")>]
new Java.Util.Concurrent.ThreadPoolExecutor : int * int * int64 * Java.Util.Concurrent.TimeUnit * Java.Util.Concurrent.IBlockingQueue -> Java.Util.Concurrent.ThreadPoolExecutor

Parameters

corePoolSize
Int32

the number of threads to keep in the pool, even if they are idle, unless allowCoreThreadTimeOut is set

maximumPoolSize
Int32

the maximum number of threads to allow in the pool

keepAliveTime
Int64

when the number of threads is greater than the core, this is the maximum time that excess idle threads will wait for new tasks before terminating.

unit
TimeUnit

the time unit for the keepAliveTime argument

workQueue
IBlockingQueue

the queue to use for holding tasks before they are executed. This queue will hold only the Runnable tasks submitted by the execute method.

Attributes

Remarks

Creates a new ThreadPoolExecutor with the given initial parameters, the Executors#defaultThreadFactory default thread factory and the ThreadPoolExecutor.AbortPolicy default rejected execution handler.

It may be more convenient to use one of the Executors factory methods instead of this general purpose constructor.

Java documentation for java.util.concurrent.ThreadPoolExecutor.ThreadPoolExecutor(int, int, long, java.util.concurrent.TimeUnit, java.util.concurrent.BlockingQueue<java.lang.Runnable>).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

ThreadPoolExecutor(Int32, Int32, Int64, TimeUnit, IBlockingQueue, IRejectedExecutionHandler)

Creates a new ThreadPoolExecutor with the given initial parameters and the Executors#defaultThreadFactory default thread factory.

[Android.Runtime.Register(".ctor", "(IIJLjava/util/concurrent/TimeUnit;Ljava/util/concurrent/BlockingQueue;Ljava/util/concurrent/RejectedExecutionHandler;)V", "")]
public ThreadPoolExecutor (int corePoolSize, int maximumPoolSize, long keepAliveTime, Java.Util.Concurrent.TimeUnit? unit, Java.Util.Concurrent.IBlockingQueue? workQueue, Java.Util.Concurrent.IRejectedExecutionHandler? handler);
[<Android.Runtime.Register(".ctor", "(IIJLjava/util/concurrent/TimeUnit;Ljava/util/concurrent/BlockingQueue;Ljava/util/concurrent/RejectedExecutionHandler;)V", "")>]
new Java.Util.Concurrent.ThreadPoolExecutor : int * int * int64 * Java.Util.Concurrent.TimeUnit * Java.Util.Concurrent.IBlockingQueue * Java.Util.Concurrent.IRejectedExecutionHandler -> Java.Util.Concurrent.ThreadPoolExecutor

Parameters

corePoolSize
Int32

the number of threads to keep in the pool, even if they are idle, unless allowCoreThreadTimeOut is set

maximumPoolSize
Int32

the maximum number of threads to allow in the pool

keepAliveTime
Int64

when the number of threads is greater than the core, this is the maximum time that excess idle threads will wait for new tasks before terminating.

unit
TimeUnit

the time unit for the keepAliveTime argument

workQueue
IBlockingQueue

the queue to use for holding tasks before they are executed. This queue will hold only the Runnable tasks submitted by the execute method.

handler
IRejectedExecutionHandler

the handler to use when execution is blocked because the thread bounds and queue capacities are reached

Attributes

Remarks

Creates a new ThreadPoolExecutor with the given initial parameters and the Executors#defaultThreadFactory default thread factory.

Java documentation for java.util.concurrent.ThreadPoolExecutor.ThreadPoolExecutor(int, int, long, java.util.concurrent.TimeUnit, java.util.concurrent.BlockingQueue<java.lang.Runnable>, java.util.concurrent.RejectedExecutionHandler).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

ThreadPoolExecutor(Int32, Int32, Int64, TimeUnit, IBlockingQueue, IThreadFactory)

Creates a new ThreadPoolExecutor with the given initial parameters and the ThreadPoolExecutor.

[Android.Runtime.Register(".ctor", "(IIJLjava/util/concurrent/TimeUnit;Ljava/util/concurrent/BlockingQueue;Ljava/util/concurrent/ThreadFactory;)V", "")]
public ThreadPoolExecutor (int corePoolSize, int maximumPoolSize, long keepAliveTime, Java.Util.Concurrent.TimeUnit? unit, Java.Util.Concurrent.IBlockingQueue? workQueue, Java.Util.Concurrent.IThreadFactory? threadFactory);
[<Android.Runtime.Register(".ctor", "(IIJLjava/util/concurrent/TimeUnit;Ljava/util/concurrent/BlockingQueue;Ljava/util/concurrent/ThreadFactory;)V", "")>]
new Java.Util.Concurrent.ThreadPoolExecutor : int * int * int64 * Java.Util.Concurrent.TimeUnit * Java.Util.Concurrent.IBlockingQueue * Java.Util.Concurrent.IThreadFactory -> Java.Util.Concurrent.ThreadPoolExecutor

Parameters

corePoolSize
Int32

the number of threads to keep in the pool, even if they are idle, unless allowCoreThreadTimeOut is set

maximumPoolSize
Int32

the maximum number of threads to allow in the pool

keepAliveTime
Int64

when the number of threads is greater than the core, this is the maximum time that excess idle threads will wait for new tasks before terminating.

unit
TimeUnit

the time unit for the keepAliveTime argument

workQueue
IBlockingQueue

the queue to use for holding tasks before they are executed. This queue will hold only the Runnable tasks submitted by the execute method.

threadFactory
IThreadFactory

the factory to use when the executor creates a new thread

Attributes

Remarks

Creates a new ThreadPoolExecutor with the given initial parameters and the ThreadPoolExecutor.AbortPolicy default rejected execution handler.

Java documentation for java.util.concurrent.ThreadPoolExecutor.ThreadPoolExecutor(int, int, long, java.util.concurrent.TimeUnit, java.util.concurrent.BlockingQueue<java.lang.Runnable>, java.util.concurrent.ThreadFactory).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

ThreadPoolExecutor(Int32, Int32, Int64, TimeUnit, IBlockingQueue, IThreadFactory, IRejectedExecutionHandler)

Creates a new ThreadPoolExecutor with the given initial parameters.

[Android.Runtime.Register(".ctor", "(IIJLjava/util/concurrent/TimeUnit;Ljava/util/concurrent/BlockingQueue;Ljava/util/concurrent/ThreadFactory;Ljava/util/concurrent/RejectedExecutionHandler;)V", "")]
public ThreadPoolExecutor (int corePoolSize, int maximumPoolSize, long keepAliveTime, Java.Util.Concurrent.TimeUnit? unit, Java.Util.Concurrent.IBlockingQueue? workQueue, Java.Util.Concurrent.IThreadFactory? threadFactory, Java.Util.Concurrent.IRejectedExecutionHandler? handler);
[<Android.Runtime.Register(".ctor", "(IIJLjava/util/concurrent/TimeUnit;Ljava/util/concurrent/BlockingQueue;Ljava/util/concurrent/ThreadFactory;Ljava/util/concurrent/RejectedExecutionHandler;)V", "")>]
new Java.Util.Concurrent.ThreadPoolExecutor : int * int * int64 * Java.Util.Concurrent.TimeUnit * Java.Util.Concurrent.IBlockingQueue * Java.Util.Concurrent.IThreadFactory * Java.Util.Concurrent.IRejectedExecutionHandler -> Java.Util.Concurrent.ThreadPoolExecutor

Parameters

corePoolSize
Int32

the number of threads to keep in the pool, even if they are idle, unless allowCoreThreadTimeOut is set

maximumPoolSize
Int32

the maximum number of threads to allow in the pool

keepAliveTime
Int64

when the number of threads is greater than the core, this is the maximum time that excess idle threads will wait for new tasks before terminating.

unit
TimeUnit

the time unit for the keepAliveTime argument

workQueue
IBlockingQueue

the queue to use for holding tasks before they are executed. This queue will hold only the Runnable tasks submitted by the execute method.

threadFactory
IThreadFactory

the factory to use when the executor creates a new thread

handler
IRejectedExecutionHandler

the handler to use when execution is blocked because the thread bounds and queue capacities are reached

Attributes

Remarks

Creates a new ThreadPoolExecutor with the given initial parameters.

Java documentation for java.util.concurrent.ThreadPoolExecutor.ThreadPoolExecutor(int, int, long, java.util.concurrent.TimeUnit, java.util.concurrent.BlockingQueue<java.lang.Runnable>, java.util.concurrent.ThreadFactory, java.util.concurrent.RejectedExecutionHandler).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to