- Conor
(1) Inside the tinyOS event-driven concurrency system, does the atomic section (including called function) occupy the CPU and run until completion, such that even an async event (interrupt) can not preempt it? -- even assume the protected variables has nothing related with the async event functions?
(I just read app.c, seems like that's the way how __nesc_atomic_start implemented, please confirm!)
static inline __nesc_atomic_t __nesc_atomic_start(void )
{
__nesc_atomic_t result = are_interrupts_enabled();
#line 222
__nesc_disable_interrupt();
return result;
}
(2) I have tried to compare SurgeM.nc with app.c under build/telosb. I notice this "atomic" section is not atomic in app.c -- is this a bug? Or when the atomic keyword will be ignored?
async event result_t Sensor.dataReady(uint16_t data) {
atomic {
if (!gfSendBusy) {
gfSendBusy = TRUE;
gSensorData = data;
post SendData();
}
}
return SUCCESS;
}
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
--
"Thought is only a flash in the middle of a long night, but the flash that means everything."
- Poincaré
-=-=-=-=-=-=-=-=-
I'm going to run the Houston Marathon, but finishing's not my only goal: help me raise money for cancer research!
http://www.active.com/donate/tnttxgc/tnttxgcCTodd
Thanks!
_______________________________________________ Tinyos-help mailing list [email protected] https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
