[ECOS] FW: [ECOS] ecos state machine

Geoff Patch grp@cea.com.au
Tue Aug 13 23:11:00 GMT 2002


> hi,nickg!
>    mail box in ecos maybe unsafe :
>             char *msg="hello!nickg";
>           cyg_mbox_put(mbox,(void*)msg);
>            ...
>           free(msg);
>           return //danger:if now msg has not  yet received.
>

No. The mailbox mechanism is not unsafe. That particular usage is unsafe.

The mailbox mechanism allows the application programmer to transmit data
from one thread to another. If the programmer does something dangerous, the
problem lies with the programmer, not the mailbox mechanism.

In other words, it's up to you to ensure that the contents of the mailbox
points to something sensible when the receiving thread accesses it.

Cheers


Geoff

-----------------------------
Geoff Patch
Senior Software Engineer
CEA Technologies
Canberra Australia
02-6213-0


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss



More information about the Ecos-discuss mailing list