Commit Graph
96 Commits
Author SHA1 Message Date
Patrick Pelissier cc6da8941c * Fix wanings for reduce precision on integers.
* Add wrapper for strncat
2020-06-22 00:14:37 +02:00
Patrick Pelissier f4b9185ceb Update documentation on QUEUE_MPMC 2020-06-06 11:09:55 +02:00
Patrick Pelissier 78d0bfb286 Port new error oplist format to all containers. 2020-05-30 18:00:43 +02:00
Patrick Pelissier d1ae26f0fd * Add control than the type and the oplist are compatible 2020-05-17 10:27:30 +02:00
Patrick Pelissier 49a2e600c4 Add control of sub-oplist when creating a new oplist of a container
Add test case of this new control
Fix some corner bugs in some containers evolving their own oplists.
2020-05-15 21:19:39 +02:00
Patrick Pelissier 113fdbf388 Add more controls on proper presence of oplist for _DEF macros 2020-05-09 17:16:00 +02:00
Patrick Pelissier 4f7b0b9455 Happy new year 2020 2020-01-04 15:41:06 +01:00
Patrick Pelissier 5111b0c726 Deprecated some buffer options since the _blocking functions are much more usefull 2019-12-27 16:39:42 +01:00
Patrick Pelissier c8f2c0e06e Add _push_move method for SPSC 2019-07-11 13:38:40 +02:00
Patrick Pelissier 03be814a4d Uniformize macro names 2019-06-09 11:38:39 +02:00
Patrick Pelissier d70ef53283 Add _push_force for QUEUE SPSC 2019-01-20 23:59:33 +01:00
Patrick Pelissier 0f3bf6ab82 Add _bulk version for SPSC queue. To test/bench 2019-01-15 23:27:02 +01:00
Patrick Pelissier 475836e851 Use of new macro M_CACHELINE_ALIGN 2019-01-15 19:11:10 +01:00
Patrick Pelissier 72e872c768 Remove outdated comment 2019-01-15 07:34:19 +01:00
Patrick Pelissier 08822ac7d5 Update 2019-01-15 07:25:11 +01:00
Patrick Pelissier 8b3a4a802c Happy new year! 2019-01-02 18:12:07 +01:00
Patrick Pelissier a8620c3aff Export method _size for operator GET_SIZE 2018-11-25 18:00:47 +01:00
Patrick Pelissier 19d48740cd Modify prototype of buffer _init_set & _set to allow const argument for src. Not proud of the solution. 2018-10-27 16:13:02 +02:00
Patrick Pelissier 1047d842d0 Add OPLIST for buffer & an example. Still a WIP for the constness of the BUFFER source. 2018-10-26 23:30:04 +02:00
Patrick Pelissier 77385e53f7 Add _init1 for buffer (internal use) 2018-10-26 22:23:44 +02:00
Patrick Pelissier f7b3de2750 Add test cases for _init_set & _set for buffers 2018-10-26 22:05:14 +02:00
Patrick Pelissier 41cf523dfc Adding _set & _init_set for buffer (to test) 2018-10-26 21:21:29 +02:00
Patrick Pelissier 2e3b312fab Fix issue of recursive usage of M_GLOBAL_OPLIST_OR_DEF
Update the way to use the macro to avoid being limited by the
preprocessor limitation.
2018-09-14 20:57:55 +02:00
Patrick Pelissier bb8de993b6 Start porting to M_CALL infrastructure, enabling support for
API transformation.
2018-09-08 22:49:12 +02:00
Patrick Pelissier 3b0e940284 Add missing _ptr & _srcptr alias. 2018-08-19 17:58:23 +02:00
Patrick Pelissier 5c8429a7bb Reformating 2018-08-16 07:29:22 +02:00
Patrick Pelissier 824011657a Improve once again mapping of the buffer structure to avoid
false sharing.
2018-08-15 10:33:20 +02:00
Patrick Pelissier 8e2031bf5a Add comments. 2018-08-15 10:30:17 +02:00
Patrick Pelissier 8bb5f5475e Avoid putting the push mutex & the pop mutex inside the same cache line.
Avoid false sharing for multi-threading scenario and should increase performance.
2018-08-15 10:21:23 +02:00
Patrick Pelissier aba1ac1646 Fix issue in 64 bits with overwriting enabled for buffer. 2018-08-02 23:31:48 +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 70a4fd99f4 iFix buiild issue with mutex based atomics. 2018-06-29 21:43:33 +02:00
Patrick Pelissier 0bf84a321b Add missing methods _capacity for MPMC queue & SPSC queue. 2018-06-27 07:28:34 +02:00
Patrick Pelissier 08f44845ce Fix issue for SPSC queue:
computing the number of elements in the queue is not reliable enough
as we can get more than than the size of the queue.
2018-04-26 22:41:11 +02:00
Patrick Pelissier 4fbffc4788 Use plain 'unsigned int' instead of 'unsigned long long'
for index of SPSC queues. There is no issue as we don't compare
the index, but only substract them.
2018-04-26 22:38:43 +02:00
Patrick Pelissier 8cf4050d3d Remove uneeded alignment constraint for SPSC queue. 2018-04-26 22:26:30 +02:00
Patrick Pelissier 005207cfd6 Remove a warning in release mode. 2018-04-26 22:05:36 +02:00
Patrick Pelissier f3de34a62b Optimization for MPMC queues:
* use of atomic_explicit functions to give the memory order we want,
* reduce the size of the index to unsigned int: even if there is an
overflow, it doesn't matter as we don't compare the index with < or >
but with ==.
2018-04-19 22:15:37 +02:00
Patrick Pelissier ba72e4ebbf Remove check in protected contract:
since there are two mutex now, there are data race when we want to check it.
TODO: Properly separate the contract.
2018-03-17 19:54:59 +01:00
Patrick Pelissier d82dc196e0 Fix datarace (?) if support for pop deferred has been activated
(a rewake of thread may be lost)
2018-03-16 23:55:16 +01:00
Patrick Pelissier f2b2335080 Fix issue with C++ not supporting passing an int constant value to an unsigned atomic type...
I definitely find this disturbing.
2018-03-16 22:59:51 +01:00
Patrick Pelissier cbb881df86 Fix overwrite branch which has a data race on number.
Rewrite it to be simpler & faster and without data race.
2018-03-10 10:13:54 +01:00
Patrick Pelissier 103e5304e8 Use of 2 mutex for buffer:
* one for the enqueue
* one for the dequeue
The number of items in the buffer is the only variable which can be accessed
by both at the same time.
This improve the performance of the communication and reduce the possibility
of priority inversion between the producer and the consummer thread.
2018-03-09 21:07:21 +01:00
Patrick Pelissier 65f39ab22e Optmize the buffer queue:
don't broadcast the condition variable if we know that
 no thread is waiting for it.
 Improve bench test from 700ms to 450ms
2018-03-09 19:15:47 +01:00
Patrick Pelissier c71613dcfe Don't display warnings about unused variables in release mode. 2018-02-28 21:05:15 +01:00
Patrick Pelissier b1443533e0 Update comment 2018-02-27 22:41:11 +01:00
Patrick Pelissier 2da51ea6e9 Remove constraint on size > 0
as workers can create a queue of size 0
in mono core system.
2018-02-23 22:12:17 +01:00
Patrick Pelissier d0e7cc41bf Add more assertions 2018-02-23 20:40:44 +01:00
Patrick Pelissier a1e791d1e9 Add queue SPSC 2018-02-23 20:38:51 +01:00
Patrick Pelissier 264249fb8b Improve queue MPMC contract checking 2018-02-23 20:13:04 +01:00