Sponsored Content
Top Forums Programming Persisting message queues to disk Post 302380797 by fpmurphy on Wednesday 16th of December 2009 08:07:40 AM
Old 12-16-2009
Rather than reinvent the wheel, I suggest you use a message queueing protocol such as AMQP. Implementations include Redhat's MRG, RabbitMQ, Apache Qpid and OpenAMQ.
 

10 More Discussions You Might Find Interesting

1. Programming

Message queues

Hi all, I've been trying for hours to figure out how to turn my 2-program (one to send and one to receive) "chat system" using message queues, into a single program where each concurrent component (entity) will both send and receive messages. PLEASE give me a hand with this, I'm starting to... (9 Replies)
Discussion started by: mgchato
9 Replies

2. UNIX for Dummies Questions & Answers

message queues

let 3 processes a, b and c are sharing msgs using msg queues.process 'a' sending msg to 'c' and in turn 'c' send sthat msg to 'b'.if something happens to c how can 'a' and 'b' know that 'c' is not available?????? (2 Replies)
Discussion started by: sukaam
2 Replies

3. Solaris

rogue message queues solaris 9

We have message queues created from our ERP system to our tax system via an application api written by the ERP software vendor. Occasionally when a user does not gracefully exit the ERP application, the message queue hangs. After a few months, this becomes a problem as the queues are all used... (2 Replies)
Discussion started by: MizzGail
2 Replies

4. Linux

maximun number of message queues

how to check the maximun number of message queues in current linux enviornment? is there any command ? (4 Replies)
Discussion started by: princelinux
4 Replies

5. UNIX for Advanced & Expert Users

UNIX Message Queues vs. Sockets

If I use sockets for IPC, and can easily distribute my applications. UNIX Message Queues are local to the processor. As I understand it, Message Queues still incur system call overhead, just like socket calls. What advantage does a UNIX Message Queue provide versus a TCP or UDP Socket,... (2 Replies)
Discussion started by: zen29sky
2 Replies

6. Programming

message queues and multi-process

Hi, Am supposed to use message queues to send and receive messages between the processes. when i was working on that i realised that the message qid and the message queue related data should be maintained in a shared memory so that it can be accessed by all the processes. Could anybody refer... (10 Replies)
Discussion started by: rvan
10 Replies

7. UNIX for Advanced & Expert Users

message queues

#include <sys/ipc.h> #include <sys/msg.h> int main() { int qid; int t; struct msgbuf mesg; qid=msgget(IPC_PRIVATE,IPC_CREAT); mesg.mtype=1L; mesg.mtext=1; t=msgsnd(qid,&mesg,1,0); printf("%d",t); } the program prints -1 as the result of msgsnd ,which means that msgsnd doesn't... (1 Reply)
Discussion started by: tolkki
1 Replies

8. UNIX for Dummies Questions & Answers

message queues

can any body provide a tutorial that explains the concept of message queues in UNIX in great detail (1 Reply)
Discussion started by: asalman.qazi
1 Replies

9. Shell Programming and Scripting

Cleaning Message Queues

i have an application installed on AIX 5.3 and i have made a script that shutdown a proccesses that exceeded 10000kb of memory usage but i have a problem with cleaning the message queues of these proccesses after shutting them down. Is there any way to clean the message queues for this particular... (8 Replies)
Discussion started by: Portabello
8 Replies

10. UNIX for Advanced & Expert Users

Performance calculation for Message Queues

i have a program(C++ Code) that sends/receives information through queue's (Uses MQ) Is there any UNIX/LINUX tool that calculates the load and performance time for the same. If not how do i design the program that calculates the performance time. i know that time.h can be used but it gives... (2 Replies)
Discussion started by: vkca
2 Replies
iv_work(3)						    ivykis programmer's manual							iv_work(3)

NAME
IV_WORK_POOL_INIT, iv_work_pool_create, iv_work_pool_put, IV_WORK_ITEM_INIT, iv_work_pool_submit_work - ivykis worker thread management SYNOPSIS
#include <iv_work.h> struct iv_work_pool { int max_threads; void *cookie; void (*thread_start)(void *cookie); void (*thread_stop)(void *cookie); }; struct iv_work_item { void *cookie; void (*work)(void *cookie); void (*completion)(void *cookie); }; void IV_WORK_POOL_INIT(struct iv_work_pool *this); int iv_work_pool_create(struct iv_work_pool *this); int iv_work_pool_put(struct iv_work_pool *this); void IV_WORK_ITEM_INIT(struct iv_work_item *work); int iv_work_pool_submit_work(struct iv_work_pool *this, struct iv_work_item *work); DESCRIPTION
Calling iv_work_pool_create on a struct iv_work_pool object previously initialised by IV_WORK_POOL_INIT creates a pool of worker threads that can be used to offload CPU intensive tasks to, so as to prevent negatively influencing event handling latency in the calling thread, and to enable the use of multiple host CPUs for CPU intensive tasks. iv_work dynamically adjusts the number of threads in the pool to the amount of work there is to do. The ->max_threads member of struct iv_work_pool specifies the maximum number of threads that will be created in this pool. Calling iv_work_pool_submit_work on a struct iv_work_item object previously initialised by IV_WORK_ITEM_INIT submits a work item to a pool. The ->work member of struct iv_work_item specifies the function that will be called in one of the worker threads in the pool specified by ->this, with ->cookie as its sole argument. When the work function has completed, iv_work will call the ->completion callback to indicate this, also with ->cookie as its sole argument, in the thread that iv_work_pool_create was called in for this pool object. As a special case, calling iv_work_pool_submit_work with a NULL work pool pointer will cause the work item to be processed in the local thread, from an iv_task(3) callback. If the ->thread_start function pointer specified in struct iv_work_pool is not NULL, it will be called upon creation of a new worker thread, in the context of the created worker thread, with ->cookie as its sole argument. Calls to ->thread_start are not explicitly seri- alised, which should be kept in mind when manipulating state shared between threads from within that callback function. Similarly, if iv_work decides to terminate a worker thread, for example due to inactivity, ->thread_stop will be called in the context of the terminating thread, with ->cookie as its sole argument. Calls to ->thread_stop are also not explicitly serialised. iv_work_pool_submit_work can only be called from the thread that iv_work_pool_create for this pool object was called in. There is no way to cancel submitted work items. There is no guaranteed order, FIFO or otherwise, between different work items submitted to the same worker thread pool. When the user has no more work items to submit to the pool, its reference to the pool can be dropped by calling iv_work_pool_put. If there are still pending or running work items assigned to this pool when iv_work_pool_put is called, those work items will not be can- celed, but will be allowed to run to completion, and their ->completion callbacks will be called as usual. A similar thing holds for the ->thread_start and ->thread_stop callbacks -- they can also still be called after iv_work_pool_put returns. Even so, the memory corre- sponding to the struct iv_work_pool can immediately be freed or reused by the user upon return of the iv_work_pool_put call. Internally, iv_work uses iv_thread(3) for its thread management. SEE ALSO
ivykis(3), iv_thread(3) ivykis 2010-09-14 iv_work(3)
All times are GMT -4. The time now is 03:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy