Forum Discussion
Altera_Forum
Honored Contributor
14 years agomultiprocessor: Share same variable
Hi , I try to implement a c-code for multiprocessor architecture(3 CPU). I need to know if it is possible that the three processor share the same variable. For example i declare an integer "var...
Altera_Forum
Honored Contributor
12 years agoHello,
I am also working on implementing mutex for data sharing amongst 4 cores. I want to share a particular on chip memory address amongst 4 cores. I included one mutex in my qsys design and using the below code format in my 4 cores: # ifdef MUTEX_BASE m1 = altera_avalon_mutex_open( "/dev/mutex"); # endif if (!altera_avalon_mutex_trylock (m1, ALT_CPU_CPU_ID_VALUE)) { done0 = IORD(OnChip,1); //On chip memory access altera_avalon_mutex_unlock (m1); } When I run any first core, it runs. When I run any second core, the first core is PAUSED. Please suggest.