Skip to content
robertking edited this page Jun 21, 2021 · 1 revision

Managing orbit

Orbit is an operating system abstraction to run auxiliary tasks. Orbit provides strong isolation, good observability, and high performance. We provide a set of tools of orbit for developers to utilize this abstraction in their systems.

Orbit has a separate execution life cycle from the main process. If the orbit process crashes, the main process is not affected. The main process can choose to restart the orbit automatically. If the main process fails, the orbit can also detach from the main process, and reattach to a restarted main program instance. In such way, orbit can also carry data from the last execution.

Creating an orbit

One orbit serves one process. One process, on the other hand, can create multiple orbits.

The orbit creation API is defined as:

struct orbit_module *orbit_create(const char *module_name,
		orbit_entry entry_func, void*(*init_func)(void));

The created orbit entity is managed by the orbit_module struct.

The entry_func option is used as the default entry function to execute in the orbit for each orbit call. User can also specify another function at orbit calls and override this value once. For more information, see orbit call.

After successful creation of orbit, the orbit runtime will call the user-defined initialization function init_func once. The initialization function can do any initializations to global data and can also do allocations. It can also allocate a custom data structure and return a void*. This return value will be used as the store argument in the entry function, and it can be used to preserve data across multiple orbit calls.If the init_func is NULL, nothing will be called, and NULL will be passed as store in orbit entry function.

TODO: can we allow NULL default entry_func? TODO: allow arguments to init_func.

Destroying orbit

User can use the following APIs to destroy one or all orbits.

int orbit_destroy(obid_t gobid);
int orbit_destroy_all();

User can also use the following APIs to check whether the orbit is still alive or not.

bool orbit_exists(struct orbit_module *ob);
bool orbit_gone(struct orbit_module *ob);

Enforcing resource limits

TBD