This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Using alarm


On Fri, Aug 03, 2001 at 11:20:41AM +0800, Ho Shui Choy Stanley NCS wrote:
> Hi
> The program hangs when the alarm triggers for the first time and stops in
> the alarm function at the while loop.
> Can anyone please advice on what is the cause?

Alarm handlers run in something like a DSR. That means you cannot call
functions that could block. In your example you do reads on an IO
device. This is probably blocking, which is fatal. Instead your alarm
handler should post on a semaphore to wake up a thread to do the work.

        Andrew



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]