Actually, a better algorithm would be:
while (should still communicate)
{
wait for incomming data with a small timeout
if (!timeouted)
process bytes received
if (need to send some data)
send the data
}
This way you can process incomming data a soon as PalmOS will give it you.
My previous algorithm may have allowed the receive FIFO to overflow while
your app was waiting.
One caveat :) of this algorithm is that your transmit rate will be
slowed-down by the receive timeout.
Cheers,
James.
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Viraj
Chatterjee
Sent: Tuesday, 10 July 2001 15:54
To: Palm Developer Forum
Subject: Re: Multithreading in Palm OS
I quote from the Palm OS Companion document that comes with the SDK.
[.. snip]
Palm OS applications are generally single-threaded, event-driven
programs.
[snip..]
-vc
----- Original Message -----
From: "Jeyanthi" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Tuesday, July 10, 2001 11:10 AM
Subject: Multithreading in Palm OS
> Hi,
> I want to know about creating threads in Palm OS. In my application I
> will be having two threads. In one thread I will be continuously reading
> data from the port and in other thread I will be using the read data. Is
> it possible? Can anyone of you help me regarding this?
>
> Thanks and Regards,
>
> Jeyanthi
>
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/
>
--
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/