public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* RE: [ECOS] Pthread problem
@ 2008-02-15 11:43 Davies, Greg
  2008-02-15 20:19 ` Gary Thomas
  0 siblings, 1 reply; 8+ messages in thread
From: Davies, Greg @ 2008-02-15 11:43 UTC (permalink / raw)
  To: ecos-discuss

-----Original Message-----
From: Enno Lübbers [mailto:enno.luebbers@upb.de]
Sent: Thursday, February 14, 2008 3:21 PM

have you tried using eCos threads instead of pthreads? The pthreads implementation uses Cyg_Threads, so this way you could determine if it's a compat/posix-related problem or whether maybe your eCos scheduler config (or something similar) is wrong.


Thanks for the suggestion. I tried to run the simple two thread example from the documentation, but I couldn't get it to run. The problem with trying this is that the pthreads are kind of wrapped up in everything, so by the time I get my configuration to the point where I can use Cyg_Threads, I'm debugging a whole different application. I'm going to see if they can run side by side today. I figure that's my best bet.

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

^ permalink raw reply	[flat|nested] 8+ messages in thread
* [ECOS] Pthread problem
@ 2008-02-14 13:10 Davies, Greg
  2008-02-14 19:22 ` Enno Lübbers
  2008-02-15  2:28 ` Andrew Lunn
  0 siblings, 2 replies; 8+ messages in thread
From: Davies, Greg @ 2008-02-14 13:10 UTC (permalink / raw)
  To: ecos-discuss

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-02-15 20:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-15 11:43 [ECOS] Pthread problem Davies, Greg
2008-02-15 20:19 ` Gary Thomas
2008-02-15 20:46   ` Davies, Greg
2008-02-15 20:51     ` Gary Thomas
  -- strict thread matches above, loose matches on Subject: below --
2008-02-14 13:10 Davies, Greg
2008-02-14 19:22 ` Enno Lübbers
2008-02-15  2:28 ` Andrew Lunn
2008-02-15 20:10   ` Davies, Greg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).