Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

multi process sous uclunix

Altera_Forum
Honored Contributor II
1,173 Views

hi all 

i want to know if in µclinux wa can starte two application as two process to be communication between there , i have not the MMU ,
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
379 Views

That task is not at all specific NIOS or using an MMU. It's just a general Linux question.  

 

There are multiple ways. One very often used is to read and write pipes.  

 

You can test the appropriate user land software on any PC Linux box. 

 

-Michael
0 Kudos
Altera_Forum
Honored Contributor II
379 Views

so i can use Fork() to create mutiprocess in my µclinux without MMU.?!!! 

and thant i want to start toww application in same time , how i can do that,? 

thank'you
0 Kudos
Altera_Forum
Honored Contributor II
379 Views

With noMMU Architecture, fork() is not available. You need to use vfork() instead. AFAIK, in MMU-Linux vfork() usually is mapped to fork(), so you can just always use vfork() unless you need some specifics of fork that vfork does not provide.  

 

I don't know what you mean by "start two applications". But one application can use (v)fork() and friends to start another application, either using it's own code (thus working similar as a multi-thredded application) or load new code from a file.  

 

-Michael
0 Kudos
Altera_Forum
Honored Contributor II
379 Views

vfork() stalls the calling process until the child calls exec(). 

So you can use it if you are using pipes (or similar) for communication between different programs, but not if you want to share any data areas. 

 

Other options - which may, or may not, be available under any specific *nix. 

- System V (named) shared memory 

- threads 

- mmap(... MAP_SHARED ...) 

- named pipes/fifos
0 Kudos
Altera_Forum
Honored Contributor II
379 Views

 

--- Quote Start ---  

vfork() stalls the calling process until the child calls exec() 

--- Quote End ---  

 

 

And after that you have two processes running until the child stops.  

 

AFAIK, you need to take care that the parent does not stop before the child is gone. 

 

-Michael
0 Kudos
Reply