This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Pthread problem
- From: "Davies, Greg" <Greg dot Davies at Ultra-UEMS dot com>
- To: <ecos-discuss at sources dot redhat dot com>
- Date: Thu, 14 Feb 2008 09:07:05 -0400
- Subject: [ECOS] Pthread problem
Hi,
I'm having problems when I try to run more than two pthreads at
the same time. This is on a SAM7SE-EK board using the SAM7S-EK eCos
configuration.
The threads start up correctly and I hit the main loop of all of
them. Inside each main loop is a sched_yield() after it's done the main
work. After the last thread yields, control never returns to one of my
threads. I tried taking out all the yields, and letting ecos' preemption
take care of when to switch context, but when I do that, I only ever hit
the main loop of one of my threads. I also thought it might be a problem
with the priority of the created threads being lower than that of the
idle thread, but I haven't explored that possibility yet.
Is there something different about the way pthreads work in eCos
(the same code ran in linux)? I using the library the way I should be,
should I be sleeping instead of yielding? Could there be a configuration
item that could be causing this?
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss