Project

General

Profile

Actions

action #6158

closed

action #4600: Multi-machine support

create synchronization primitives

Added by oholecek over 9 years ago. Updated about 9 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Feature requests
Target version:
Start date:
2015-02-03
Due date:
% Done:

0%

Estimated time:

Description

Synchronization primitives (for now only mutexes are considered) are needed to properly sync multi job interdependent tasks.

Backend:

  • supported by DB table ($id, $name, $associted_job, $locked_by)

$id generated automatically for internal purposes (also primary key)
$name is id of the lock to be used in tests
$associated_job needed for auto cleanup and to create combined key with $name
$locked_by job, if not locked it is empty

ABI:

  • mutex_create($name, $associated_job)
  • mutex_lock($name, $associated_job)
  • mutex_unlock($name, $associated_job)
  • mutex_destroy($name, $associated_job)

API:

  • mutex_create($name)
  • mutex_lock($name)
  • mutex_unlock($name)

Notes:

  • when mutex is created it is automatically locked
  • when mutex does not exists it is considered as locked (so that dependant jobs can immediatelly call mutex_lock without race)
  • for now, API calls are considered to be blocking
Actions

Also available in: Atom PDF