From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paleologos Spanos To: Jonathan Larmour Cc: ecos-discuss@sources.redhat.com Subject: Re: [ECOS] Thread states Date: Wed, 10 Jan 2001 00:17:00 -0000 Message-id: References: <3A5BB308.A21EE034@redhat.com> X-SW-Source: 2001-01/msg00148.html On Wed, 10 Jan 2001, Jonathan Larmour wrote: > Paleologos Spanos wrote: > > > > Hi,I have a question regarding the state of thread. > > > > -When a thread finishes its work what is its state? the "EXITED"? > > The question is if the "exited" state is showing that the thread has > > finished execution or it is the state after having exit(with the exit > > function) the thread? > > The former - although from your description the latter would imply the > former anyway? > > > -If I want to stop the execution of a thread and then start it again from > > the beggining again(not from the point it stopped) which > > are the appropriate functions? exit and then resume,or kill and then > > resume? > > I think you are a bit confused: you call cyg_thread_exit() to exit the > calling thread; you call cyg_thread_kill() to request another thread exits. > > When the thread exits you can call cyg_thread_resume() on it. > > > -Will this thread be present on the wait_queue of the bitmap > > scheduler?(assuming that we have the bitmap scheduler) > > At what point? > From what I have understood ,the wait_queue is a number of bits with every bit to represent a specific thread which is on the scheduler.So every bit is 1 if the corresponding thread is waiting for execution or 0 if it has finished(EXITED state).Is this correct? So,in my previous mail I was asking if after a thread has completed its execution ,will the corresponding bit on the wait_queue become 0. Thank you. > Jifl > -- > Red Hat, Rustat House, Clifton Road, Cambridge, UK. Tel: +44 (1223) 271062 > Un cheval, pas du glue. Pas du cheval, beaucoup du glue. || Opinions==mine >