Page 1 of 1

ShmName

PostPosted: Mon Mar 16, 2015 11:24 am
by Nader_Jendoubi
Hi
in the "hello world" example:

what the following expressions are used for:

const char ShmName[] = "hello_shm";

e_shm_attach(&emem, ShmName);

e_shm_alloc(&mbuf, ShmName, ShmSize)

because i didn't find these 2 last functions in epiphany SDK manuel and the didn't understand the utility for ShmName

can i use e_alloc instead of these 2 functions???

Re: ShmName

PostPosted: Fri Jun 05, 2015 3:48 pm
by skinner
Hi !

Did you ever find an answer to your question because I'm quite interrested myself to know in which case it is better to use e_alloc or e_shm_alloc ?

If not then at least I can say that e_shm_alloc has basically the same behaviour as e_alloc except that you give a name (a tag) to the shared memory space. This way you can "attach" yourself to this shared memory space by giving its name to e_shm_attach. As far as I understand, it allows us not to care about the offsets inside the shared area since there must be some hidden mechanism taking care of it with the tag/name system.

Regards,

Thomas.

Re: ShmName

PostPosted: Tue Sep 29, 2015 9:30 am
by etim
I'm wondering this too. Is it like a key or pointer to a block of memory that is auto assigned?