Gonzalo, Threads are a piece of cake to implement and have each thread attach to the required queue, you are on the wrong track with select() and socket I/O.
What is your client architecture ?? and development language choice ? Sid -----Original Message----- From: Gonzalo Diethelm [mailto:[EMAIL PROTECTED]] Sent: Sunday, 5 January 2003 1:03 PM To: [EMAIL PROTECTED] Subject: Re: Demultiplexing instead of polling? I will rephrase my question, in the hopes to elicit answers from the more knowledgeable. I need to monitor several queues for incoming messages, from a single client program. I can see one way of doing it would be to have several threads, each with a loop polling on a specific queue. There are several problems with this approach: it requires threads, with all the associated issues regarding their proper termination, and it implies an active, rather than passive, role. The other way this is usually handled is to have some means of demultiplexing, akin to what is provided by the select() call in UNIX environments: you put a reference to each resource you want to monitor inside a data structure, and pass that to a call that basically: * implies NO ACTIVITY on the calling program. * times out after a specified amount of time. * returns when there is activity on any of the resources. My question is: is this passive demultiplexing mechanism supported in any way under MQ? I believe it is supported somehow in z/OS (or whatever it is called), but not in general; is this correct? Thanks, -- Gonzalo A. Diethelm [EMAIL PROTECTED] > -----Original Message----- > From: Gonzalo Diethelm [mailto:[EMAIL PROTECTED]] > Sent: Friday, January 03, 2003 16:29 > To: MQSeries List > Subject: Demultiplexing instead of polling? > > > [Probably a FAQ] > > When one issues an MSGGET, I understand the call is synchronous, > that is, the caller waits until the call returns (or until a > user-specified timeout expires). Is there any way to do a > select()-like call, specifying several queues, that will return > when ANY of the queues has relevant information to notify to the > caller, such an incoming message, or availability to write, or > an error condition? This select() call is a typical UNIX call > used in socket programming (just in case anybody wonders). > > I'm thinking about a program that would monitor many MQ queues > and would move messages around, to other MQ queues or even to > other MOMs. Short of using one thread per monitored queue, how > can I monitor several queues at the same time? > > Thanks, > > > -- > Gonzalo A. Diethelm > [EMAIL PROTECTED] > Instructions for managing your mailing list subscription are provided in the Listserv General Users Guide available at http://www.lsoft.com Archive: http://vm.akh-wien.ac.at/MQSeries.archive Instructions for managing your mailing list subscription are provided in the Listserv General Users Guide available at http://www.lsoft.com Archive: http://vm.akh-wien.ac.at/MQSeries.archive