Random system blocking using lxrt

I'm coding a program for control of an induction motor using rtai and comedi. 

Since the date to deliver the project is close i have no time to learn how to
use kcomedilib and change the code so i used lxrt to access comedi from user
space. The program uses comedi to read a data from the dac board then it
procesess that data throught a neural algoritm and writes the result to the dac
board. Lxrt is used to manage the period between data acquisitions. 

The program works fine some times but other times it blocks the computer
completelly. 

First I used POSIX mutexes to manage access to shared memory between the control
thread and the UI thread but it blocked so then i pass it to rtai semaphores but
it still blocked finally i have changed it to mailboxes and i have also
eliminated the shared memory, now it is much more stable but still blocks. 

Can someone please take a look at the code attached to this message and tell me
what I am doing wrong?.

The complete code (with automake/autoconf stuff) can be founded in
http://arquimedes.utp.edu.co/~mono/control/control_motor2.tgz.

Thanks in advance for any help you can give me.

P.D.: Just in case someone is asking. The lxrt_wrapper stuff is used because I
was not able to include the lxrt headers in c++ directly. It gave me a sintaxis
error in some inline asambler code it has.

Received on 2002-08-05Z19:10:07