Semaphore


Object Hierarchy:

Bump.Semaphore Bump.Semaphore Bump.Semaphore Bump.TaskQueue Bump.TaskQueue Bump.TaskQueue->Bump.Semaphore GLib.Object GLib.Object GLib.Object->Bump.TaskQueue Bump.Queue Bump.Queue Bump.Queue->Bump.TaskQueue Bump.Threading Bump.Threading Bump.Threading->Bump.TaskQueue

Description:


public class Semaphore : TaskQueue

A high-level non-recursive counting semaphore

This is a semaphore designed for asynchronous GObject programming. It integrates well with the main event loop and provides features such as prioritization, cancellation, and asynchronous interfaces. Requests with higher priorities will always be executed first, and requests of equal priorities will be executed in the order in which they are requested.

Unfortunately, this is relatively slow compared to lower level mutex implementations such as GMutex and pthreads. If you don't require the advanced features, or if you only need short-lived locks, it would probably be much better to use GMutex. However, if you are writing an asynchronous GObject-based application the convenience provided by these methods can go a long way towards helping you write applications don't block the main loop and, therefore, feel faster.


Namespace: Bump
Package: bump-0.1

Content:

Properties:

Creation methods:

Methods:

Inherited Members:

All known members inherited from class Bump.TaskQueue
All known members inherited from class GLib.Object
All known members inherited from interface Bump.Queue



2022 vala-language.org