writing multi-tasking code in C..

Hello,
I am a newbie at this and was wondering how to go about doing the following:
(QNX4.25)

Say I have an application “A” running (written in C, doing some calculations
etc…) … “A” generates some output data. This data has to be passed to
another program/application “B” as input. Once this is done, “A” goes into
standby mode. “B” then works on the this data and keeps on outputting some
values.
“A” is a short duration process while “B” is of a longer duration.
Suddenly some flags are generated which should cause “A” to wake up and
cause it to run through the same set of calculations ie execute itself
again…and all this while, even while “A” is executing, “B” executes as
well…
…ie there is a finite duration of time in which both “A” & “B” will be
running simulataneously and churning out data.

it seems to me this has something to do with multi-tasking but what I dont
know is how to put this into C code and do data transfer…

Any suggestions would be highly appreciated.
Thanks in advance
Anup

\


ANUP B. KATAKE Office:
Graduate Student, 609-D, HRBB
Aerospace Engineering 3141-TAMU,
Texas A & M University. College Station, TX 77840

Tel: (979) 845-0720 (O) email: anup@tamu.edu
(979) 845-3288 (Visnav)


I am! I can!! I will!!!


inn.qnx.com” <anup@tamu.edu> wrote in message
news:a4vke8$4dh$1@inn.qnx.com

Hello,
I am a newbie at this and was wondering how to go about doing the
following:
(QNX4.25)

Say I have an application “A” running (written in C, doing some
calculations
etc…) … “A” generates some output data. This data has to be passed to
another program/application “B” as input. Once this is done, “A” goes into
standby mode. “B” then works on the this data and keeps on outputting some
values.
“A” is a short duration process while “B” is of a longer duration.
Suddenly some flags are generated which should cause “A” to wake up and
cause it to run through the same set of calculations ie execute itself
again…and all this while, even while “A” is executing, “B” executes as
well…
.ie there is a finite duration of time in which both “A” & “B” will be
running simulataneously and churning out data.

it seems to me this has something to do with multi-tasking but what I
dont
know is how to put this into C code and do data transfer…

You need to start doing some reading, this is a VERY wide range topic.
Like asking “how do I send a rocket into space”.

Without a 10 page response, the answer to your question is going to be
rather incomplete.

Basicaly process A should do a Send() to process B. Process B will have
to do a Receive() to receive the data from Process A. Process B then
Reply()
to Process A so it can resume it’s work. If the two processes are running
at the same priority, in round-robin mode they will get and equal share of
the CPU.
That means process A and process B will be running “simultaneously”

The multi-tasking part of it is handle by QNX4, you don’t have to do
anything
at all in your program.

Any suggestions would be highly appreciated.
Thanks in advance
Anup

\


ANUP B. KATAKE Office:
Graduate Student, 609-D, HRBB
Aerospace Engineering 3141-TAMU,
Texas A & M University. College Station, TX 77840

Tel: (979) 845-0720 (O) email: > anup@tamu.edu
(979) 845-3288 (Visnav)


I am! I can!! I will!!!