mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-18 18:23:06 +00:00
Support klists of runnables for bursting multicore
This commit is contained in:
parent
8fe21d6d05
commit
180d2addd0
@ -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)
|
public BurstExecutor queue(Runnable[] r)
|
||||||
{
|
{
|
||||||
synchronized(futures)
|
synchronized(futures)
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.volmit.iris.scaffold.parallel;
|
package com.volmit.iris.scaffold.parallel;
|
||||||
|
|
||||||
import com.volmit.iris.Iris;
|
import com.volmit.iris.Iris;
|
||||||
|
import com.volmit.iris.util.KList;
|
||||||
|
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
@ -40,6 +41,10 @@ public class MultiBurst
|
|||||||
burst(r.length).queue(r).complete();
|
burst(r.length).queue(r).complete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void burst(KList<Runnable> r) {
|
||||||
|
burst(r.size()).queue(r).complete();
|
||||||
|
}
|
||||||
|
|
||||||
public void sync(Runnable... r)
|
public void sync(Runnable... r)
|
||||||
{
|
{
|
||||||
for(Runnable i : r)
|
for(Runnable i : r)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user