mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-12-26 18:49:06 +00:00
Support klists of runnables for bursting multicore
This commit is contained in:
@@ -27,6 +27,19 @@ public class BurstExecutor
|
||||
}
|
||||
}
|
||||
|
||||
public BurstExecutor queue(KList<Runnable> r) {
|
||||
synchronized(futures)
|
||||
{
|
||||
for(Runnable i : r)
|
||||
{
|
||||
CompletableFuture<Void> c = CompletableFuture.runAsync(i, executor);
|
||||
futures.add(c);
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
public BurstExecutor queue(Runnable[] r)
|
||||
{
|
||||
synchronized(futures)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.volmit.iris.scaffold.parallel;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.util.KList;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
@@ -40,6 +41,10 @@ public class MultiBurst
|
||||
burst(r.length).queue(r).complete();
|
||||
}
|
||||
|
||||
public void burst(KList<Runnable> r) {
|
||||
burst(r.size()).queue(r).complete();
|
||||
}
|
||||
|
||||
public void sync(Runnable... r)
|
||||
{
|
||||
for(Runnable i : r)
|
||||
|
||||
Reference in New Issue
Block a user