Examples of ParallelTask


Examples of one.nio.async.ParallelTask

        final HashSet<Serializer> serializers = new HashSet<Serializer>();
        if (serializer.uid() >= 0) {
            serializers.add(serializer);
        }

        AsyncExecutor.fork(new ParallelTask() {
            @Override
            public void execute(int taskNum, int taskCount) throws IOException, ClassNotFoundException {
                SerializerCollector collector = new SerializerCollector(mmap.getAddr(), mmap.getSize());

                for (int i = taskNum; i < capacity; i += taskCount) {
View Full Code Here

Examples of one.nio.async.ParallelTask

        long startTime = System.currentTimeMillis();
        long startFreeMemory = allocator.getFreeMemory();
        final AtomicInteger totalConverted = new AtomicInteger();

        AsyncExecutor.fork(allocator.segments(), new ParallelTask() {
            @Override
            public void execute(int taskNum, int taskCount) throws IOException, ClassNotFoundException {
                Malloc localAllocator = allocator.segment(taskNum);
                int converted = 0;
View Full Code Here

Examples of one.nio.async.ParallelTask

    public void iterate(Visitor<K, V> visitor) {
        iterate(visitor, 0, 1);
    }

    public void iterate(final Visitor<K, V> visitor, final int workers) {
        AsyncExecutor.fork(workers, new ParallelTask() {
            @Override
            public void execute(int taskNum, int taskCount) {
                iterate(visitor, taskNum, taskCount);
            }
        });
View Full Code Here

Examples of one.nio.async.ParallelTask

    public void iterate(WritableVisitor<K, V> visitor) {
        iterate(visitor, 0, 1);
    }

    public void iterate(final WritableVisitor<K, V> visitor, final int workers) {
        AsyncExecutor.fork(workers, new ParallelTask() {
            @Override
            public void execute(int taskNum, int taskCount) {
                iterate(visitor, taskNum, taskCount);
            }
        });
View Full Code Here

Examples of uk.ac.uea.threadr.ParallelTask

   */
  @Test
  public final void testAddTask() {
   
    instance = new Threadr();   
    ParallelTask task = new ReferenceTask();
    instance.addTask(task);
   
    assertNotNull("Instance returned null tasks.", instance.getTasks());
    assertEquals("Incorrect number of tasks found.", 1,
        instance.getTasks().size());
View Full Code Here

Examples of uk.ac.uea.threadr.ParallelTask

   */
  @Test
  public final void testAddTaskTestResult() {
   
    instance = new Threadr();   
    ParallelTask task = new ReferenceTask();
    instance.addTask(task, ThreadSafety.THREAD);
   
    assertNotNull("Instance returned null tasks.", instance.getTasks());
    assertNotNull("Instance returned null results.",
        instance.getThreadSafetyResults());
View Full Code Here

Examples of uk.ac.uea.threadr.ParallelTask

   */
  @Test
  public final void testAddTasksTestResultsMap() {
   
    HashMap<ParallelTask, ThreadSafety> tasks = new HashMap<>();
    ParallelTask task1 = new ReferenceTask();
    tasks.put(task1, ThreadSafety.SEQUENTIAL);
    tasks.put(new ReferenceVMTask(), ThreadSafety.VM);
    tasks.put(new ReferenceUnsafeTask(), ThreadSafety.THREAD);
   
    instance = new Threadr();
View Full Code Here

Examples of uk.ac.uea.threadr.ParallelTask

   * Test the {@link VMWrapper#equals(Object)} method is working correctly.
   */
  @Test
  public final void testEquality() {
       
    ParallelTask task1 = new ReferenceTask();
   
    VMWrapper wrapper1Task1 = new VMWrapper(task1);
    VMWrapper wrapper2Task1 = new VMWrapper(task1);
    VMWrapper wrapper1Task2 = new VMWrapper(new ParallelTask() {     
      @Override
      public AbstractReturnType<?> call() {
        return null; // Don't do anything.
      }
    });
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.