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 / 290
289  |  291
Subject: 
Re: signals / legOS internals
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Sat, 26 Jun 1999 20:27:48 GMT
Viewed: 
1219 times
  
Kekoa Proudfoot wrote:

Lou Sortman  <theball@bigfoot.com> wrote:
But why do you need signals to do that?  If you are a thread, and you have
a reference to another thread (pid, pointer to thread data structure,
whatever), then there should be functions for you to manipulate the thread
you have a pointer to, including suspending and resuming that thread.

That is true.  Signals would give the task the opportunity to stop/start
tasks under its control, though, without the task that makes the calls
having to know about that relationship.  That could be done through
dedicated callbacks in the process structure, but by that point, you've
almost got signals anyway.

What am I missing?  Why do you need callbacks in the process structure?  I
was thinking if you can reference the thread, you can just call a system
function (e.g. suspend(thread)), and that will suspend the thread.  You do
not need callbacks anywhere to do this; suspend(thread) just removes the
specified thread from whatever queue it is waiting on and puts it on a
suspended list.

Or maybe you want signals because you do not want the thread to be
suspended immediately, but you want the thread to be able to recognize that
some other thread wants it to suspend itself, and take action accordingly
(so maybe it can free locks or something)?  In that case, you are right,
you need signals to do that.

Yes, that is it.  A classic example is a full screen app such as vi.
When being stopped, vi sets the terminal mode to something generic and
saves any screen info that it needs.  When resumed, it sets the terminal
mode back to what it wants and redraws the screen.  Now, obviously,
running screen apps on the brick would be silly, but that is an example.



Message has 1 Reply:
  Re: signals / legOS internals
 
(...) So is the idea that you might have a "shell" app that lets you control a button or two and that takes over the lcd at times (say), and lets you start, suspend, and stop other apps that control different, presumably disjoint sets of motors and (...) (25 years ago, 26-Jun-99, to lugnet.robotics.rcx.legos)

Message is in Reply To:
  Re: signals / legOS internals
 
(...) What am I missing? Why do you need callbacks in the process structure? I was thinking if you can reference the thread, you can just call a system function (e.g. suspend(thread)), and that will suspend the thread. You do not need callbacks (...) (25 years ago, 26-Jun-99, to lugnet.robotics.rcx.legos)

32 Messages in This Thread:









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

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

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