I've seen a couple of posts on this list regarding strange floating point
related crashes. I'm having such a problem, and I can't seem to solve it.

I believe it involves the fact that my floating point variables are in
shared memory (using mbuff with volatile ... however I had the same
crashing problems last week before I switched over to mbuff from the old
shared memory approach). I #include <float.h> and pthread_setfp_np. I use
the following shared memory struct:

typedef struct {
    unsigned char head;
    int scan_index;         //index holding current analog input scan
    int current_fp;         //current value of fp
    int current_xx;         //current value of state variable
    //float g;              //g feedback proportionality control parameter
    int g;                  //g feedback proportionality control parameter
    unsigned int ai_chan[NUM_AD_CHANNELS_TO_USE]; 
    unsigned char tail;
} SharedMemStruct;                  

When I compile and run my application with only int's (as it currently
reads), it doesn't crash. However if I change g to float, my application
crashes my computer occasionally, but not always. The application has
three floating point operations involving g.

Is there anything I should be doing to avoid this? My application, which
is a feedback control process, needs to use float for g, so I don't really
know how to get around this ... the one thing I'm considering is trying
RTAI ... any thoughts?

Thanks,
Dave

-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
---
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/

Reply via email to