To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 2827
2826  |  2828
Subject: 
Re: Semaphore(s) locked when task killed.
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Thu, 5 Sep 2002 14:43:46 GMT
Viewed: 
5002 times
  
This has been suggested and may very well be the best way to handle manual
removal of a runaway task.  I plan to investigate this once I get my current
updates squared-away.

I hope this type of handling can be done in the kernel only. User tasks
shouldn't have to deal with this low-level detail.  I believe, for lnp and
memory it can be done.

// Joe

"Albert Huang" <sfitw@hotmail.com> wrote in message
news:H1xLEr.A01@lugnet.com...
> Have you considered implementing thread cleanup handlers?  Similar to what
> pthread_cleanup_push and pthread_cleanup_pop provide.
> 
> "Joseph Woolley" <jwoolley@spamblock.insight.rr.com> wrote in message
> news:H1w6v9.8M0@lugnet.com...
> > I have found that killing a task which is sending data via lnp will • cause
> > lnp to stop functioning.  Turning the brick off then on again will get • lnp
> > working again.  The issue is with the semaphore(s) used in the kernel • tasks.
> > 
> > Currently there is no mechanism to track what semaphores are locked by a
> > task.  When killall is used to end a task (which is commonly done) the • task
> > will terminate prior to releasing the semaphores it has locked.
> > 
> > So, the question is, what is a good solution to this problem?
> > 
> > I tried a quick patch for the specific issue I encountered... where
> > program.c waits for the semaphore to be released before calling killall
> > (handling the run/stop button).  However, this is a poor solution since • the
> > task in question may have entered an infinite loop or encountered other • such
> > problems.
> > 
> > I am working on a patch that tracks the semaphores locked by a task. • kill
> > and killall can then release the semaphores while killing the task.
> > However, there may be a better solution.
> > 
> > // Joe
> > 
> > 
> 
> 



Message is in Reply To:
  Re: Semaphore(s) locked when task killed.
 
Have you considered implementing thread cleanup handlers? Similar to what pthread_cleanup_push and pthread_cleanup_pop provide. "Joseph Woolley" <jwoolley@spamblock....ht.rr.com> wrote in message news:H1w6v9.8M0@lugnet.com... (...) tasks. (...) task (...) (24 years ago, 4-Sep-02, to lugnet.robotics.rcx.legos)

7 Messages in This Thread:




Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR