public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS]  thread_create stack base=NULL or size=0?
@ 2009-04-15 15:56 Grant Edwards
  2009-04-15 16:08 ` Nick Garnett
  0 siblings, 1 reply; 3+ messages in thread
From: Grant Edwards @ 2009-04-15 15:56 UTC (permalink / raw)
  To: ecos-discuss

While looking into a DHCP management thread stack overflow
problem, I've noticed comments in multiple places implying that
when calling cyg_thread_create you can pass a NULL stack_base
pointer to cyg_thread_create and/or a 0 stack_size.

However, I can't find either of those possibilites mentioned in
the documentation or in the code itself (though I don't really
read C++).

Can somebody explain the behavior of cyg_thread_create when the
stack-base is NULL or when a stack-size is 0?

-- 
Grant Edwards                   grante             Yow! World War III?
                                  at               No thanks!
                               visi.com            


-- 
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] 3+ messages in thread

* Re: [ECOS]  thread_create stack base=NULL or size=0?
  2009-04-15 15:56 [ECOS] thread_create stack base=NULL or size=0? Grant Edwards
@ 2009-04-15 16:08 ` Nick Garnett
  2009-04-16  6:56   ` [ECOS] " Grant Edwards
  0 siblings, 1 reply; 3+ messages in thread
From: Nick Garnett @ 2009-04-15 16:08 UTC (permalink / raw)
  To: Grant Edwards; +Cc: ecos-discuss

 Grant Edwards <grante@visi.com> writes:

> While looking into a DHCP management thread stack overflow
> problem, I've noticed comments in multiple places implying that
> when calling cyg_thread_create you can pass a NULL stack_base
> pointer to cyg_thread_create and/or a 0 stack_size.
> 
> However, I can't find either of those possibilites mentioned in
> the documentation or in the code itself (though I don't really
> read C++).
> 
> Can somebody explain the behavior of cyg_thread_create when the
> stack-base is NULL or when a stack-size is 0?

In the original design it was intended that there be an option to
allow the kernel to malloc all data structures, including thread
stacks (which may have had a default size, selected by zero). This is
why the object structure is passed in as the last argument, and we
return a "handle", which is just a copy of the structure address.

Ultimately we decided not to do that and make the user supply all
memory. However, the API features for this remained, and comments were
left in the code. 


-- 
Nick Garnett                                       eCos Kernel Architect
eCosCentric Limited    http://www.eCosCentric.com       The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.      Tel: +44 1223 245571
Registered in England and Wales:                         Reg No: 4422071


-- 
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] 3+ messages in thread

* [ECOS]  Re: thread_create stack base=NULL or size=0?
  2009-04-15 16:08 ` Nick Garnett
@ 2009-04-16  6:56   ` Grant Edwards
  0 siblings, 0 replies; 3+ messages in thread
From: Grant Edwards @ 2009-04-16  6:56 UTC (permalink / raw)
  To: ecos-discuss

On 2009-04-15, Nick Garnett <nickg@ecoscentric.com> wrote:
>  Grant Edwards <grante@visi.com> writes:
>
>> Can somebody explain the behavior of cyg_thread_create when the
>> stack-base is NULL or when a stack-size is 0?
>
> In the original design it was intended that there be an option
> to allow the kernel to malloc all data structures, including
> thread stacks (which may have had a default size, selected by
> zero). This is why the object structure is passed in as the
> last argument, and we return a "handle", which is just a copy
> of the structure address.
>
> Ultimately we decided not to do that and make the user supply
> all memory. However, the API features for this remained, and
> comments were left in the code.

Thanks.  Now I don't feel so bad about not being able to figure
out how that feature was implemented in the C++ source code.

[Though I should know by now not to pay much attention to comments.]

-- 
Grant Edwards                   grante             Yow! You can't hurt me!!
                                  at               I have an ASSUMABLE
                               visi.com            MORTGAGE!!


-- 
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] 3+ messages in thread

end of thread, other threads:[~2009-04-15 18:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-15 15:56 [ECOS] thread_create stack base=NULL or size=0? Grant Edwards
2009-04-15 16:08 ` Nick Garnett
2009-04-16  6:56   ` [ECOS] " Grant Edwards

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).