This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Multiple thread support in eCos


On Mon, Sep 08, 2003 at 06:43:36PM +0530, Ravi Joshi wrote:

> 1. The program creates two threads thread_1 and thread_2 that
> continuously print integer values from 1 to 10 in while(1) so that
> the threads will not exit. The threads are being created in the
> main() function.

> 2. But when the program runs on the board. The application stops
> after printing the integers 1 to 10 from both the threads and nothing
> seems to be happening after that. The main() function is waiting on
> an event that never gets set. This has been done to assure that the
> main should not exit since the threads are running continuously.

The threads will continue to run after main has exited. eCos does not
put threads into a tree like unix processes. Threads are independent
of each other. Threads can terminate without affecting each other.

> Here are my queries:
> 1. How do I know that multiple thread support has been enabled in the ecos kernel?
> 
> 2. If not enabled, what are the steps to enable it?

It enabled by default, so unless you have some strange configuration,
it should be enabled.
 
> 3. Can multiple threads run simultaneously in eCos(scenario of
> multiple servers waiting for the incoming connections
> simultaneously)

Depends on how you define simultaneously. For true simultaneous
execution you need a SMP machine, which your hardware is not. For time
sharing simultaneous operation than eCos can do that.

> 4. Any clue why my appplication is not able to run multiple threads?

Lets see the source. You say they stop after printing 10? Why 10?
There should be no context switch if all you have is a plain while(1)
loop. 

     Andrew






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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]