home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / isis / 372 < prev    next >
Encoding:
Text File  |  1993-01-12  |  5.0 KB  |  108 lines

  1. Newsgroups: comp.sys.isis
  2. Path: sparky!uunet!cis.ohio-state.edu!zaphod.mps.ohio-state.edu!rpi!batcomputer!cornell!glade
  3. From: glade@cs.cornell.edu (Bradford Glade)
  4. Subject: Re:  Question about isis and C++
  5. Message-ID: <1993Jan12.153638.11834@cs.cornell.edu>
  6. Organization: Cornell Univ. CS Dept, Ithaca NY 14853
  7. Date: Tue, 12 Jan 1993 15:36:38 GMT
  8. Lines: 98
  9.  
  10.   In article <MTC.93Jan7194423@latina.inesc.pt> mtc@inesc.pt writes:
  11.   >I am trying to use isis from a C++ program and I'm having a problem :
  12.   >
  13.   >When I call :
  14.   >
  15.   >        isis_entry(QUERY_ENTRY, (void (*) (message*))cback_receive_query,
  16.   >                                                    "cback_receive_query");
  17.   >
  18.   >        I would like to send an extra parameter to the 
  19.   >        "cback_receive_query" 
  20.   >        callback function, namely the "this" pointer.
  21.   >
  22.   >        I can do it successfully with the "isis_mainloop" call, but
  23.   >        not with the 
  24.   >        "isis_entry". isis_mainloop expects a (void (*) (void *)) callback
  25.   >        parameter, instead of a (void (*) (message*)) as isis_entry does.
  26.   >
  27.   >Could anyone help me solving this problem ?
  28.  
  29.  
  30. While this won't help you today, the next academic release of the Isis
  31. system (with the Horus kernel) will directly support this type of use.
  32. Each thread in Horus takes two arguments, an environment pointer,
  33. which is typically defined by the same code that declares the thread,
  34. and an argument pointer which is defined by the code that spawns the
  35. thread.  In practice, both of these arguments tend to be pointers to
  36. structures containing many fields.  For instance, the environment
  37. pointer may contain file descriptors for the output streams that the
  38. thread should use, etc. The argument pointer for upcalls in Horus
  39. typically take an event structure, which among other fields includes a
  40. field for a message.  This is how messages get delivered from Horus.  
  41. So in your situation you would either supply the "this" pointer as the
  42. environment, or would make it a field in a structure that you supply
  43. as an argument to the upcall (callback).
  44.  
  45.   From Ken:
  46.   >This is a common complaint about Isis from C++...  Most
  47.   >C++ users (we have plenty of them) specify a straight C function for
  48.   >these callbacks, and then have that function demultiplex incoming
  49.   >messages by passing them to the correct object instance.  Normally,
  50.   >this involved including enough information at the front of each messaghe
  51.   >to figure which object(s) will need to see the message.
  52.  
  53. In addition the release should include some support for remote method
  54. invocation and object naming.  While the shape of the interface is
  55. still to be determined, the tool will be responsible for the
  56. demultiplexing of messages to their corresponding objects, and for
  57. triggering methods upon message delivery.  The tool will also provide
  58. support for object migration and will make use of the state transfer
  59. facility in the VSync library (which sits above the Horus kernel). 
  60.  
  61.   From Ken:
  62.   >This points to another limitation.  If you try and think of individual
  63.   >objects as members of groups, instead of thinking of the process in which
  64.   >they live as the group member, you might have one object try to become a
  65.   >client of a group G, while two others try and join G and yet another
  66.   >decides to leave G.  
  67.  
  68.   >This is because the objects in a C++ system tend not to know about
  69.   >each other and so if an object class includes code to join,leave or
  70.   >call pg_client, each separate instance will try to do that, possibly
  71.   >on the same group.
  72.  
  73.   >But, Isis doesn't let one address space -- one heavyweight program --
  74.   >belong to a group multiple times.  Olof Hagsand did a nice paper on
  75.   >this with Holger Herzog, Robert Cooper and I when visiting.  He
  76.   >can send a copy (email: olof@sics.se).  So, you need to avoid such
  77.   >behavior, and this says that individual object instances should
  78.   >normally not join and leave groups directly, unless you have a different
  79.   >group for each object instance.
  80.  
  81.   >Brad Glade has been working on a new kind of "lighweight" object interface
  82.   >for Isis that would work much better.  Perhaps he could post something
  83.   >about this to the newsgroup -- Brad?
  84.  
  85. The Horus kernel and the VSync library support what are known as
  86. lightweight groups.  These are intended, in part, to solve the problem
  87. that Ken mentions above.  Lightweight groups will allow you to
  88. associate a single group with each object that you create.  In this
  89. manner the object can behave independently and not worry about the
  90. other objects that share its address space.  The lightweight group
  91. layer of the VSync library manages these groups so that they make
  92. efficient use of the basic groups provided by the Horus kernel.  This
  93. layer is in turn used by the object support tools as a transport for
  94. message passing and for object naming.  I'll post more on the
  95. interface to the lightweight group layer as it solidifies.
  96.  
  97. -Brad.
  98.  
  99.  
  100.  
  101.  
  102.  
  103. -- 
  104. Bradford B. Glade             |  glade@cs.cornell.edu    
  105. Dept. of Computer Science     |  Tel. (607) 255-9124 (Office)
  106. 314 Upson Hall Cornell Univ.  |  FAX  (607) 255-4428 (CS Dept.)
  107. Ithaca, NY 14853              |  
  108.