create mailbox
More...
#include <Mbox.h>
create mailbox
this is a queue, lockfree multi-producer single consumer adapted from: http://www.cs.rochester.edu/research/synchronization/pseudocode/queues.html
Definition at line 46 of file Mbox.h.
lockfree producer adapted from: http://www.cs.rochester.edu/research/synchronization/pseudocode/queues.html
Definition at line 37 of file Mbox.cc.
References current, currentMsg, firstMsg, getInt128FromPointer(), head, lastMsg, Message::messageStruct, mutexLast, myLastMsg, mytail, Message::nextmsg, PAYLOADNONE, Message::message_s::payloadtype, and tail.
51 pthread_mutexattr_t attr;
52 attr.__align = PTHREAD_MUTEX_ADAPTIVE_NP;
uint64_t Mbox::getCount |
( |
__int128 |
i128) | |
|
|
static |
__int128 Mbox::getInt128FromPointer |
( |
class Message * |
ptr, |
|
|
uint64_t |
count |
|
) |
| |
|
static |
create 128bit integer from Message object
- Parameters
-
ptr | Message variant |
count | count component |
- Returns
Definition at line 106 of file Mbox.cc.
Referenced by Mbox(), and MboxProducer::sendMsg().
109 memcpy(&i128, &ptr,
sizeof(ptr));
110 memcpy((uint64_t *)&i128+1, &count,
sizeof(count));
class Message * Mbox::getPtr |
( |
__int128 |
i128) | |
|
|
static |
class Message * Mbox::receive |
( |
int |
timeout) | |
|
pthread_mutex_t Mbox::mutexLast |
|
private |
The documentation for this class was generated from the following files:
- /home/infinisql/build/infinisql/infinisqld/Mbox.h
- /home/infinisql/build/infinisql/infinisqld/Mbox.cc