[Info-vax] MQ series client support AST?
rockdale
rockdale.green at gmail.com
Fri Dec 11 09:56:01 EST 2009
> If I'm not wrong, you could also read from the MQ-queue
> with a timeout, that is, you are stuck in the read until
> something arrivs on the queue *or* the timeout "times-out".
> At timeout you can just re-issue the read operation.
What I am using is the classic Poll (according to Hein). In a while
loop, I do mqget, if returns data then process the data , if nothing
returns, sleep 1 sec do mqget again...
My application major task is to transmit messages between two systems
(let's call them MQ server and system B), MQ server have 2 queues,
one
for my application read from, another one is for my application write
to. My application read a message from MQ server, process the
message,
send this message to system B via tcp/ip socket connection. At the
same time, when my application receive a message from system B via
tcp/
ip socket(here we are using sys at qio and ast), my appl process the
message and then put(mqput) it into the MQ server.
I also have a stateFlag to show the current status of MQ
communication, IDLE, GET or PUT to avoid race condition, before mqget
if the stateFlag is PUT, then I will skip this mqget, this is where
my
customer does not like it and the ast question comes up.
Does the flag to avoid race condition necessary? since they are not
the same queue. (forgive my ignorance, MQ and OpenVMS are very new to
me.)
I was think to use multi threads for this situation, sprawl another
thread to poll and read from the mq server. But if I still need to
handle the race condition, does multi-threads do any good to this
situation?
Thanks for all your help
-Rockdale
More information about the Info-vax
mailing list