mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-04-08 16:56:25 +00:00
Works, but somehow i broke parallax
This commit is contained in:
@@ -1,16 +1,37 @@
|
||||
package com.volmit.iris.scaffold.parallel;
|
||||
|
||||
import com.volmit.iris.Iris;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ThreadFactory;
|
||||
|
||||
public class MultiBurst
|
||||
{
|
||||
public static MultiBurst burst = new MultiBurst(Runtime.getRuntime().availableProcessors());
|
||||
private ExecutorService service;
|
||||
private int tid;
|
||||
|
||||
public MultiBurst(int tc)
|
||||
{
|
||||
service = Executors.newWorkStealingPool(tc);
|
||||
service = Executors.newFixedThreadPool(tc, new ThreadFactory()
|
||||
{
|
||||
@Override
|
||||
public Thread newThread(Runnable r)
|
||||
{
|
||||
tid++;
|
||||
Thread t = new Thread(r);
|
||||
t.setName("Iris Generator " + tid);
|
||||
t.setPriority(Thread.MAX_PRIORITY);
|
||||
t.setUncaughtExceptionHandler((et, e) ->
|
||||
{
|
||||
Iris.info("Exception encountered in " + et.getName());
|
||||
e.printStackTrace();
|
||||
});
|
||||
|
||||
return t;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void burst(Runnable... r)
|
||||
|
||||
Reference in New Issue
Block a user