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++
12745 Discussions

Cost of Creating threads at run-time

Altera_Forum
Honored Contributor II
1,132 Views

In an embedded system running uClinux, is it inefficient to be creating new threads all the time? (i.e. the overhead for creating threads) 

 

In my application, I want to create a thread whenever I need to do a blocking DMA call. Once the DMA is finished, the thread exits. 

 

My friend said that it's "better" to create all the threads I need to at the initialization, then use semaphore to signal it to run. Is it really better? 

 

I think that kind of complicates things up because then I need to use global variables and mutex to pass data between threads? 

 

Lastly, is there a better way to share data between threads by not using global variable?
0 Kudos
0 Replies
Reply