This is the mail archive of the
ecos-discuss@sourceware.cygnus.com
mailing list for the eCos project.
Re: Threads that end
- To: jens dot ohlund at secrc dot abb dot se
- Subject: Re: [ECOS] Threads that end
- From: Jonathan Larmour <jlarmour at redhat dot co dot uk>
- Date: Thu, 29 Jun 2000 17:43:16 +0100
- CC: ecos-discuss at sourceware dot cygnus dot com, Robert Erskine <roberte at redhat dot co dot uk>
- Organization: Red Hat UK Ltd.
- References: <OF0E2D96CA.0BF977C1-ONC125690D.0022923A@secrc.abb.se>
jens.ohlund@secrc.abb.se wrote:
>
> Hi !
>
> I wonder what happens when a thread leaves the method it was given to run when created.
> Does it just "run away" or does it "die" (suspend) or what ?
>
[snip]
> Does the thread leaves the method, frees up resources and turns to a suspend mode ?
It doesn't free up resources, but it does suspend.
> If it does, does that mean I have to delete it afterwards to make it disaper in the scheduler ?
Indeed so, use cyg_thread_delete() for that. See
http://sourceware.cygnus.com/ecos/docs-latest/ref/ecos-ref.9.html#pgfId=1088577
[ although Robert take note: the HTML fonts in this bit are all wrong ]
In summary, cyg_thread_kill() sends a kill message to a thread, causing it
to wake up and return an error message from whatever it's locked in the
kernel doing. cyg_thread_delete() deregisters the thread from the
scheduler, freeing up the thread resources (although not any resources
allocated by the thread itself, if you see what I mean).
Jifl
--
Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS Tel: +44 (1223) 728762
"Plan to be spontaneous tomorrow." || These opinions are all my own fault