[ECOS] "Threads on ecos" confirmation needed...

Ivan Horvat ihorvat@xylon.hr
Fri Jan 30 19:25:00 GMT 2004

Dirk Broer wrote:

>As best I can tell.
>We use POSIX interface to threads.  We join on the threads all the time.  At
>some points of execution, I can say we are creating and destroying 5 threads
>a second, potentially over an extended period of time with no ill effects.
>All threads are joined, but we don't do much in the way of cleanup so its
>not a tough test.  Threads are encapsulated in a C++ object, using static
>methods for callbacks.
>Lessons learned
>1) Consider ECOS threads directly if you can.  POSIX threads aren't named
>and makes debugging easier.
>2) We need to clean up our thread per task algorithm.  (yeah, sure, when we
>have time).

Nice lessons, especially 1) :-)

I actually want to avoid joining threads. I'm using omnithread wrapper 
which is
actually broken for DETACHED type of threads: it deletes the object 
the storage for Cyg_Thread object (returned by cyg_thread_create()) 
before calling
cyg_thread_exit(), which soon crashes the scheduler.
There is no ill effects using UNDETACHED treads only if there is a 
periodical check
to join them as much as possible, but this is not very elegant. The 
pthreads are more
common so I would like to use that API instead, but it obviously have 
some drawbacks...


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

More information about the Ecos-discuss mailing list