* 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
* Re: [ECOS] Pthread problem
2008-02-15 11:43 [ECOS] Pthread problem Davies, Greg
@ 2008-02-15 20:19 ` Gary Thomas
2008-02-15 20:46 ` Davies, Greg
0 siblings, 1 reply; 8+ messages in thread
From: Gary Thomas @ 2008-02-15 20:19 UTC (permalink / raw)
To: Davies, Greg; +Cc: ecos-discuss
Davies, Greg wrote:
> -----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.
>
Have you tried running the standard eCos pthread examples?
In particular, 'pthread2' tests just what you seem to be
having trouble with.
# make -C compat/posix/current tests
--
------------------------------------------------------------
Gary Thomas | Consulting for the
MLB Associates | Embedded world
------------------------------------------------------------
--
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
* RE: [ECOS] Pthread problem
2008-02-15 20:19 ` Gary Thomas
@ 2008-02-15 20:46 ` Davies, Greg
2008-02-15 20:51 ` Gary Thomas
0 siblings, 1 reply; 8+ messages in thread
From: Davies, Greg @ 2008-02-15 20:46 UTC (permalink / raw)
To: Gary Thomas; +Cc: ecos-discuss
> -----Original Message-----
> From: Gary Thomas [mailto:gary@mlbassoc.com]
> Sent: Friday, February 15, 2008 4:19 PM
> Have you tried running the standard eCos pthread examples?
> In particular, 'pthread2' tests just what you seem to be
> having trouble with.
>
> # make -C compat/posix/current tests
>
I didn't even realise there were pthreads examples. I must have missed
those somehow. I definitely check those Monday.
--
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
* Re: [ECOS] Pthread problem
2008-02-15 20:46 ` Davies, Greg
@ 2008-02-15 20:51 ` Gary Thomas
0 siblings, 0 replies; 8+ messages in thread
From: Gary Thomas @ 2008-02-15 20:51 UTC (permalink / raw)
To: Davies, Greg; +Cc: ecos-discuss
Davies, Greg wrote:
>> -----Original Message-----
>> From: Gary Thomas [mailto:gary@mlbassoc.com]
>> Sent: Friday, February 15, 2008 4:19 PM
>> Have you tried running the standard eCos pthread examples?
>> In particular, 'pthread2' tests just what you seem to be
>> having trouble with.
>>
>> # make -C compat/posix/current tests
>>
> I didn't even realise there were pthreads examples. I must have missed
> those somehow. I definitely check those Monday.
>
Indeed, there are unit tests for most everything in eCos :-)
Of course, if there's something you think needs to be tested
further, feel free to contribute some code!
--
------------------------------------------------------------
Gary Thomas | Consulting for the
MLB Associates | Embedded world
------------------------------------------------------------
--
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
* RE: [ECOS] Pthread problem
2008-02-15 2:28 ` Andrew Lunn
@ 2008-02-15 20:10 ` Davies, Greg
0 siblings, 0 replies; 8+ messages in thread
From: Davies, Greg @ 2008-02-15 20:10 UTC (permalink / raw)
To: Andrew Lunn; +Cc: ecos-discuss
> On Thu, Feb 14, 2008 at 09:07:05AM -0400, Davies, Greg wrote:
> > 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.
>
> Problems like this are typically to do with the stack being
> too small and you overwrite the thread structure. Turn on
> INFRA_DEBUG and try with bigger stacks.
>
> Andrew
I had tried the stack thing before, but it didn't help. In some cases when I made it too big, it caused my debugger to stop working. I turned on some of the debugging features and some other things, and it started working. I'm not sure exactly which option made it start working again though. I think that's a story for another day.
--
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
* Re: [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
2008-02-15 20:10 ` Davies, Greg
1 sibling, 1 reply; 8+ messages in thread
From: Andrew Lunn @ 2008-02-15 2:28 UTC (permalink / raw)
To: Davies, Greg; +Cc: ecos-discuss
On Thu, Feb 14, 2008 at 09:07:05AM -0400, Davies, Greg wrote:
> 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?
Problems like this are typically to do with the stack being too small
and you overwrite the thread structure. Turn on INFRA_DEBUG and try
with bigger stacks.
Andrew
--
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
* Re: [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
1 sibling, 0 replies; 8+ messages in thread
From: Enno Lübbers @ 2008-02-14 19:22 UTC (permalink / raw)
To: ecos-discuss; +Cc: Davies, Greg
Hi,
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.
Regards,
- Enno
--
Dipl.-Ing. Enno Luebbers
Computer Science Department
University of Paderborn
Warburger Str. 100
33098 Paderborn
http://wwwcs.upb.de/cs/ag-platzner
phone: 05251 / 60-5397
fax: 05251 / 60-5377
--
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).