Carbide Scheduler is a high-performance, priority-based task scheduling and execution framework for concurrent Java environments. It provides advanced mechanisms for task management, resource coordination, cancellation, and memory optimization.
To include Carbide Scheduler in your project, add the following to your Gradle dependencies:
implementation 'com.github.M4ximumPizza:Carbide:1.0.4'- BusyReferenceCounter.java: Utility for tracking references to shared resources, helping manage resource contention.
- Cancellable.java: Lightweight cancellation token for cooperative task cancellation.
- CancellationSignaller.java: Thread-safe utility for propagating cancellation signals and notifying listeners.
- ObjectFactory.java: Factory interface for creating pooled objects.
- package-info.java: Package-level documentation.
- ExecutorManager.java: Central manager for scheduling and executing tasks, handling priorities and lock dependencies.
- LockToken.java: Represents a lock required by a task for resource coordination.
- SimpleTask.java: Basic implementation of the
Taskinterface for tasks without lock dependencies. - Task.java: Interface defining a unit of work, including execution, exception handling, and lock management.
- WorkerThread.java: Worker thread that polls tasks from the queue, acquires locks, executes tasks, and releases locks.
- DynamicPriorityQueue.java: Lock-free, multi-level priority queue supporting dynamic re-prioritization of tasks.
- ObjectPool.java: High-performance, thread-safe object pool for reusing preallocated instances and reducing memory overhead.
- Assertions.java: Lightweight runtime checks for validating conditions during development and debugging.
- EDFScheduler.java: Scheduler implementation using Earliest Deadline First (EDF) algorithm for time-based task prioritization.
- EDFTask.java: Task implementation compatible with EDF scheduling, including deadline management.
- FairScheduler.java: Scheduler implementation that ensures fair distribution of execution among tasks.
- Late.java: Utility for handling late or overdue tasks.
- SingleAssignmentMap.java: Map structure allowing single assignment per key, useful for immutable mappings.
- WeightedTask.java: Task implementation supporting weighted priorities for more granular scheduling.
- Task Submission: Submit tasks to
ExecutorManagerwith priority and optional lock dependencies. - Task Execution: Worker threads poll tasks, acquire necessary locks, and execute them.
- Lock Management: Locks are acquired before execution and released afterward, allowing dependent tasks to proceed.
- Cancellation and Completion: Tasks or signals can be cancelled or marked as completed, triggering registered listeners.
- Resource Recycling: Object pooling optimizes memory usage in performance-critical paths.
- Concurrent task scheduling (job schedulers, game engines)
- Dependency management via locks
- High-throughput, low-latency applications
For more detailed documentation, see SCHEDULER.md and natives.md.
This project is licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See the LICENSE file for details.