mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-19 18:55:18 +00:00
Multicore utils
This commit is contained in:
parent
1306a5bca1
commit
7d7269bfe6
@ -0,0 +1,12 @@
|
|||||||
|
package com.volmit.iris.gen.v2.scaffold.multicore;
|
||||||
|
|
||||||
|
import com.volmit.iris.gen.v2.scaffold.hunk.Hunk;
|
||||||
|
|
||||||
|
public interface BurstedHunk<T> extends Hunk<T>
|
||||||
|
{
|
||||||
|
public int getOffsetX();
|
||||||
|
|
||||||
|
public int getOffsetY();
|
||||||
|
|
||||||
|
public int getOffsetZ();
|
||||||
|
}
|
@ -5,18 +5,19 @@ import java.util.concurrent.Executors;
|
|||||||
|
|
||||||
public class MultiBurst
|
public class MultiBurst
|
||||||
{
|
{
|
||||||
|
public static MultiBurst burst = new MultiBurst(Runtime.getRuntime().availableProcessors());
|
||||||
private ExecutorService service;
|
private ExecutorService service;
|
||||||
|
|
||||||
public MultiBurst(int tc)
|
public MultiBurst(int tc)
|
||||||
{
|
{
|
||||||
service = Executors.newWorkStealingPool(tc);
|
service = Executors.newWorkStealingPool(tc);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BurstExecutor burst(int estimate)
|
public BurstExecutor burst(int estimate)
|
||||||
{
|
{
|
||||||
return new BurstExecutor(service, estimate);
|
return new BurstExecutor(service, estimate);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BurstExecutor burst()
|
public BurstExecutor burst()
|
||||||
{
|
{
|
||||||
return burst(16);
|
return burst(16);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user