|
Hi TechTalk,
I'm having some difficulties when migrating from VxWorks to RTEMS around how timeouts seem to be handled for very short periods.
Under VxWorks, I set a clock speed of 1000, i.e. 1kHz. I then had some events that had a timeout of 10 "ticks", so a wall time of 10ms. This event was triggered when the associated hardware finishes its read/write cycle - it would send an interrupt, and in
the handler I signal the waited-on event. Interrupts were also often turned off, to save CPU time, so the events would just timeout but this caused no issues as the hardware read/write would complete inside the 10ms.
Under RTEMS, I have a different clock speed of 100Hz. I set the same timeout of 10ms (0.01s). I also have interrupts disabled so that the Event will never be signalled. I see different behaviour - some of my reads/writes now report errors, as though they are
attempting to execute too fast and not actually waiting the 10ms for the hardware to act.
This seems to be backed up by using EPICS' nanosecond timing functions. Using "epicsTimeGetCurrent" before and after the "epicsEventWaitWithTimeout" function, and then calling "epicsTimeDiffInNS" gives a mean and median duration of ~5ms between the before and
after times. I suspect this means the EPICS Event Wait function is not actually waiting at all.
Is this somehow to do with the fact I'm trying to wait for exactly one tick? Or is there some other explanation for why my wait time is not being reached?
Thank you for any help,
Alex Wells
This e-mail and any attachments may contain confidential, copyright and or privileged material, and are for the use of the intended addressee only. If you are not the intended addressee or an authorised recipient of the addressee please notify us of receipt
by returning the e-mail and do not use, copy, retain, distribute or disclose the information in or attached to the e-mail. Any opinions expressed within this e-mail are those of the individual and not necessarily of Diamond Light Source Ltd.
Diamond Light Source Ltd. cannot guarantee that this e-mail or any attachments are free from viruses and we cannot accept liability for any damage which you may sustain as a result of software viruses which may be transmitted in or with the message.
Diamond Light Source Limited (company no. 4375679). Registered in England and Wales with its registered office at Diamond House, Harwell Science and Innovation Campus, Didcot, Oxfordshire, OX11 0DE, United Kingdom.
|