[plug] Scheduling and Blocking Explained

Beau Kuiper kuiperba at cs.curtin.edu.au
Thu May 18 21:03:14 WST 2000


On Thu, 18 May 2000, Mike Holland wrote:

> On Thu, 18 May 2000, Leon Brooks wrote:
> 
> > ...maybe. Both processes share file handles unless you say otherwise by
> > doing slightly more complex things. For comms as fast and frequent as
> > yours, learning about shared memory and/or semaphores would probably
> > help.
> 
> Would pthreads be the best way to do that? Rather than low-level
> non-portable system calls.

Please note, these are NOT low end non-portable system calls. System V
shared memory and semephores exist on MOST unix architechures (more than
pthreads). This includes:

slowarus (alright solaris)
SunOS 4.0
FreeBSD, and probably OpenBSD and NetBSD
Linux, including libc5 varients
Irix
Ultrix

I have worked with shared memory on all of these systems, and it works
perfectly on all of them.

I encorage you to use shared memory and file locks (using fcntl) or
semephores for IPC.

Hmmm, thinking about your problem, try doing a quick usleep, say 1ms then
try and read the com port. This should put your program to sleep, then
when your program restarts 1ms later, it will go through the backend
serial handler and collect the data.

Beau Kuiper
kuiperba at cs.curtin.edu.au

>
> 
> Mike Holland  <mike at golden.wattle.id.au>
>                           --==--
> antispam: rot 13 my email xor with the first 20 letters of the king james
> bible and run crypt to mail me.
> 
> 
> 




More information about the plug mailing list