| | |
| | | #include "usg_common.h" |
| | | #include "usg_typedef.h" |
| | | #include "SArrayLockFreeQueue.h" |
| | | #include "SLinkedLockFreeQueue.h" |
| | | #include "QFactory.h" |
| | | #include <pthread.h> |
| | | |
| | | #define NTHREADS 3 |
| | | #include "shm_queue.h" |
| | | #include "shm_allocator.h" |
| | | #include <sstream> |
| | | //#include "queue_factory.h" |
| | | #include <pthread.h> |
| | | #include "mm.h" |
| | | |
| | | struct Item |
| | | { |
| | |
| | | |
| | | }; |
| | | |
| | | |
| | | // typedef shmstring item_t; |
| | | typedef int item_t; |
| | | struct Targ { |
| | | int key; |
| | | int start; |
| | |
| | | }; |
| | | |
| | | // 销毁共享内存和信号 |
| | | void destroy() { |
| | | void destroy(int key) { |
| | | |
| | | SLinkedLockFreeQueue<struct Item> *queue = QFactory::createLinkedLockFreeQueue<struct Item> (1, 10); |
| | | queue->~SLinkedLockFreeQueue(); |
| | | mm_deinit(); |
| | | // LockFreeQueue<struct Item> *queue = QueueFactory::createQueue<struct Item> (1, 16); |
| | | // //queue->~LockFreeQueue(); |
| | | // delete queue; |
| | | |
| | | //QueueFactory::dropQueue<struct Item>(key); |
| | | // mm_destroy(); |
| | | |
| | | |
| | | } |