[Tinyos-help] Questions regarding concurrency in TinyOS 1.x
Adam
shiyuan69 at gmail.com
Wed Sep 6 14:08:48 PDT 2006
(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;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20060906/1aa69fe0/attachment.htm
More information about the Tinyos-help
mailing list