Bob Bowler <Bob.Bowler@rkbenterprises.com> wrote:
You can do a 16 bit ioread (in16)on the base address (PORT A) and you will
have two 8 bit values of PORT A & B in a 16bit word, effectively reading
both ports at the same time.
“Belinda” <> firstname.lastname@example.org> > wrote in message news:aa46vu$qs9$> email@example.com> …
I’m doing the codes of reading data from CIO-DIO24. PORTA and PORT B is
as input direction. I wanna implementation of reading data from two ports
the same time. I don’t know to choose which way is better, to open two
processes, each of which is to read data from one port, or to open two
threads. Or could it be implemented in one thread?
When you say two port, are you talking low level io-port, or are you
talking a higher-level source of incoming data type port?
And, when you say, at the same time, how simultaneous do you mean?
Unless you’re on SMP, you can’t do two things at the same time – you
can quickly alternate between them, or do them in quick succession, but
not at the same time.
Assuming we’re talking something like 2 data flows (analagous to
two serial ports), handling them both in the same process, and even
in a single-threaded process is probably quite acceptable.
But, without a better idea of what you really mean, it is hard to say
what is the best choice.
QNX Training Services
Please followup in this newsgroup if you have further questions.