a question on event send and receive (event when not waiting)

Chan Kim ckim at etri.re.kr
Tue Sep 1 12:55:20 UTC 2015

Yesterday I think I found ISR's task ID is kind of randomly selected.
For example, if I have thread A and thread B, and those threads causes interrupt, when I print the thread ID(task ID) inside ISR,
sometimes it matches with the thread that caused the interrupt but sometimes not. So I figure ISR is thread neutral? - taking the thread running at the moment interrupt is generated. I'm almost sure about this but could somebody confirm this?
(this is relevant to ISR sending events to tasks - the task that should receive the event. I fixed target thread ID when sending events discovering this fact..)

보낸 사람 : "Chan Kim" <ckim at etri.re.kr>
보낸 날짜 : 2015-08-31 22:51:56 ( +09:00 )
받는 사람 : users at rtems.org <users at rtems.org>
참조 : 
제목 : a question on event send and receive (event when not waiting)

Hello, rtems users,
To increase performance of my SD card driver, I'm moving a function which used to handle events from ISR and maintain state machine during a command processing into the thread that requested the SD card command processing. With this change, I request(trigger) command and enter that tasklet function in the same thread now. The tasklet(now in same thread following the request function) loops and receives events from the ISR and when everything is finished for that command, gets out of the loop. I saw the ISR has the same thread ID with the requesting thread. (so it's sending and receiving events in the same thread) (thread ID is different for file read and write somehow.)

At the beginning of the tasklet is the rtems_event_receive function. This scheme works sometimes(depending on the printk delay variation) but I saw once, an event coming from the ISR has not been catched by the rtems_event_wait function. Because the tasklet was doing something else and was not waiting for the event at that time. How do people solve this kind of situation?
can I somehow 'queue' the events so that it is detected next time rtems_event_wait function is called?

users mailing list
users at rtems.org

More information about the users mailing list