Patrick Pelissier
7b5ae3c15b
Update API so that the worker_t parameter is given on creating the sync bloc.
...
(API breakage), more RAII like.
2018-07-28 19:09:07 +02:00
Patrick Pelissier
7678625071
Review:
...
* add comments
* change error code from assertion to proper memory failure
* add new assertions
2018-07-28 13:48:30 +02:00
Patrick Pelissier
96202aa78f
Do not use reserved identifiers of the C standard (See 7.1.3 Reserved identifiers)
2018-07-14 14:35:14 +02:00
Patrick Pelissier
3f5406f1d4
API breakage:
...
worker_sync takes an extra parameter (worker_t) to perform a
wait-on-event instead of a busy waiting, reducing consummer ressources.
worker_init takes an int instead of an unsigned int for the number of workers.
It allows additional extra value -1 to initialize the number of workers to
twice the number of CPU, allowing to overload the CPU with loads and keep
them fully working in some scenario.
2018-04-16 23:57:28 +02:00
Patrick Pelissier
6cccbfc73a
Add worker_sync_p function.
2018-03-26 22:13:50 +02:00
Patrick Pelissier
1f08bcf0f8
Add clear callback for workers.
2018-01-29 22:08:21 +01:00
Patrick Pelissier
a3e2e75021
Use new macro.
2018-01-29 21:59:57 +01:00
Patrick Pelissier
210e05f7fc
Update copyright to 2018
2018-01-29 20:28:30 +01:00
Patrick Pelissier
6549bea3e0
Fix issue for BSD
2018-01-12 20:11:11 +01:00
Patrick Pelissier
83eeb5d6d0
Make the code more robust
2018-01-12 18:48:38 +01:00
Patrick Pelissier
1c9a232a9d
Add 'worker_flush' function.
...
Factorization of the exec function.
2018-01-07 22:15:58 +01:00
Patrick Pelissier
f2344c69ca
Rename worker_block_t into worker_sync_t
...
as it is a synchronization point for workers
not an anonymous block.
2017-12-28 00:03:47 +01:00
Patrick Pelissier
adc7545a42
Rename internal macros to use _USE_ as it can be modified
...
by the user.
2017-12-28 00:01:07 +01:00
Patrick Pelissier
66eff4eb44
Update comments
2017-12-27 23:59:29 +01:00
Patrick Pelissier
b4cf464e98
Fix data race.
2017-12-25 01:20:58 +01:00
Patrick Pelissier
8aa3c86ce9
Add support of C++ for workers.
2017-12-16 20:54:17 +01:00
Patrick Pelissier
9020baf364
Add option to disable worker.
2017-12-16 18:48:18 +01:00
Patrick Pelissier
1efd7e84a7
Remove some warnings about uninitilized fields with CLANG.
2017-12-16 18:24:17 +01:00
Patrick Pelissier
e2e902552e
Fix warning with GCC.
2017-12-16 17:53:39 +01:00
Patrick Pelissier
20e304b423
worker are no longer using a global variable.
...
The global variable is user defined now.
2017-12-03 17:40:59 +01:00
Patrick Pelissier
d222c7cbab
Add WORKER into M*LIB.
2017-12-03 17:31:21 +01:00