This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: re: pthreads on i686 PC


"Jason Thomas" <jason@cosmic.utah.edu> writes:

> I found this thread that I believe has something to do with the problem:
> http://sources.redhat.com/ml/ecos-devel/2003-06/msg00007.html
> 
> The pthread I'm creating is possible inheriting the attributes of the
> cyg_user_start thread above it. I would expect that some other person in
> the history of eCos has attempted to create a pthread from cyg_user_start.
> How exactly do I set up the correct pthread attributes?
> 

The POSIX package is set up to provide the environment that POSIX
compliant programs expect. Yhis means that they must start in main().
So, in your example, just change the cyg_user_start() to main() and it
should all work.

The problem is that when creating a thread, particularly when
supplying a NULL attributes pointer as you are doing, some of the
state is inherited from the parent thread. In cyg_user_start() there
is no parent thread at all, let alone one with a appropriate POSIX
attributes.

You probably could, if you were careful, set up a set of attributes
that allowed you to create a thread in cyg_user_start(). But it would
be a pointless exercise, just use main().


-- 
Nick Garnett                    eCos Kernel Architect
http://www.ecoscentric.com      The eCos and RedBoot experts


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]