[ECOS] Re: cyg_thread_get_next function and list of eCos threads

Nodir Qodirov nodir.qodirov@gmail.com
Thu Jul 9 09:55:00 GMT 2009


Sorry for simple question. After looking to source code of eCos thread
I have found an answer to my question:

> 1) "all threads in eCos are stored in linked list"
> and
> 2) "in each new thread creation it is added to system's existing thread list".
> Are these two statements true?

Where both statements are true.

In eCos all extant thread are kept in single-linked list, while
private member of class Cyg_Thread->list_next points to the next
thread and last created thread's list_next points to the first item in
the list (hence making circle of single-linked list). Static member of
Cyg_Thread::thread_list always holds pointer to the last created
thread. (packages\kernel\current\include\thread.hxx)

Cyg_Thread::add_to_list() and Cyg_Thread::remove_from_list() methods
used to encapsulate thread_list and list_next member variables of
Cyg_Thread class.

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



More information about the Ecos-discuss mailing list