# FixTask Documentation

Back to summary

## C API

### Types

`typedef Heap *(*HeapCreateFunc)(void *data);`
  Callback to create a heap for a new thread.
`typedef void (*ComputeHeapRunFunc)(Heap *heap, int idx, void *data);`
  Callback to run code on compute threads.

### Functions

`void fixtask_register_functions(Heap *heap, HeapCreateFunc create_func, void *create_data, LoadScriptFunc load_func, void *load_data);`
  Registers task functions to given heap. You have to provide callbacks to create a heap for a new thread and also a load function for loading of the scripts.
`void fixtask_get_script_load_function(Heap *heap, LoadScriptFunc *load_func, void **load_data);`
  Returns the script load function for the heap.
`int fixtask_get_cores_count(Heap *heap);`
  Returns the number of CPU cores.
`void fixtask_run_on_compute_threads(Heap *heap, Value *error, ComputeHeapRunFunc func, void *data);`
  Runs code on compute threads.