Tabnine Logo
ForkJoinPool.signalWork
Code IndexAdd Tabnine to your IDE (free)

How to use
signalWork
method
in
jsr166y.ForkJoinPool

Best Java code snippets using jsr166y.ForkJoinPool.signalWork (Showing top 8 results out of 315)

origin: h2oai/h2o-2

/**
 * Pushes a task. Call only by owner in unshared queues.
 *
 * @param task the task. Caller must ensure non-null.
 * @throw RejectedExecutionException if array cannot be resized
 */
final void push(ForkJoinTask<?> task) {
  ForkJoinTask<?>[] a; ForkJoinPool p;
  int s = top, m, n;
  if ((a = array) != null) {    // ignore if queue removed
    U.putOrderedObject
      (a, (((m = a.length - 1) & s) << ASHIFT) + ABASE, task);
    if ((n = (top = s + 1) - base) <= 2) {
      if ((p = pool) != null)
        p.signalWork();
    }
    else if (n >= m)
      growArray(true);
  }
}
origin: h2oai/h2o-2

U.compareAndSwapObject(a, i, t, null)) {
if (q.top - (q.base = b + 1) > 1)
  signalWork();    // help pushes signal
return t;
origin: h2oai/h2o-2

signalWork();
return;
origin: h2oai/h2o-2

  signalWork();               // wake up or create replacement
if (ex == null)                 // help clean refs on way out
  ForkJoinTask.helpExpungeStaleExceptions();
origin: org.codehaus.jsr166-mirror/jsr166y

/**
 * Enqueues the given task in the submissionQueue.  Same idea as
 * ForkJoinWorkerThread.pushTask except for use of submissionLock.
 *
 * @param t the task
 */
private void addSubmission(ForkJoinTask<?> t) {
  final ReentrantLock lock = this.submissionLock;
  lock.lock();
  try {
    ForkJoinTask<?>[] q; int s, m;
    if ((q = submissionQueue) != null) {    // ignore if queue removed
      long u = (((s = queueTop) & (m = q.length-1)) << ASHIFT)+ABASE;
      UNSAFE.putOrderedObject(q, u, t);
      queueTop = s + 1;
      if (s - queueBase == m)
        growSubmissionQueue();
    }
  } finally {
    lock.unlock();
  }
  signalWork();
}
origin: org.codehaus.jsr166-mirror/jsr166y

/**
 * Pushes a task. Call only from this thread.
 *
 * @param t the task. Caller must ensure non-null.
 */
final void pushTask(ForkJoinTask<?> t) {
  ForkJoinTask<?>[] q; int s, m;
  if ((q = queue) != null) {    // ignore if queue removed
    long u = (((s = queueTop) & (m = q.length - 1)) << ASHIFT) + ABASE;
    UNSAFE.putOrderedObject(q, u, t);
    queueTop = s + 1;         // or use putOrderedInt
    if ((s -= queueBase) <= 2)
      pool.signalWork();
    else if (s == m)
      growQueue();
  }
}
origin: org.codehaus.jsr166-mirror/jsr166y

if (!tryTerminate(false)) {
  if (ex != null)   // possibly replace if died abnormally
    signalWork();
  else
    tryReleaseWaiter();
origin: org.codehaus.jsr166-mirror/jsr166y

v.stealHint = w.poolIndex;
if (d != 0)
  signalWork();             // propagate if nonempty
w.execTask(t);
jsr166yForkJoinPoolsignalWork

Javadoc

Tries to activate or create a worker if too few are active.

Popular methods of ForkJoinPool

  • invoke
    Performs the given task, returning its result upon completion. If the computation encounters an unch
  • <init>
    Creates a ForkJoinPool with the given parameters.
  • execute
    Arranges for (asynchronous) execution of the given task.
  • addWorker
    Tries to create and start a worker; minimally rolls back counts on failure.
  • checkPermission
    If there is a security manager, makes sure caller has permission to modify threads.
  • deregisterWorker
    Final callback from terminating worker. Removes record of worker from array, and adjusts counts. If
  • getParallelism
    Returns the targeted parallelism level of this pool.
  • getPoolSize
    Returns the number of worker threads that have started but not yet terminated. The result returned b
  • idleAwaitWork
    If inactivating worker w has caused pool to become quiescent, check for pool termination, and wait f
  • idlePerActive
    Returns the approximate (non-atomic) number of idle threads per active thread.
  • isTerminated
    Returns true if all tasks have completed following shut down.
  • managedBlock
    Blocks in accord with the given blocker. If the current thread is a ForkJoinWorkerThread, this metho
  • isTerminated,
  • managedBlock,
  • nextWorkerName,
  • registerWorker,
  • scan,
  • tryTerminate,
  • addActiveCount,
  • addQuiescerCount,
  • addSubmission

Popular in Java

  • Reactive rest calls using spring rest template
  • findViewById (Activity)
  • requestLocationUpdates (LocationManager)
  • compareTo (BigDecimal)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now