home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / sr / info-sr.1991 < prev    next >
Internet Message Format  |  1991-12-31  |  35KB

  1. From thomas@loria.crin.fr  Fri Jan 11 05:56:10 1991
  2. Received: from inria.inria.fr by megaron.cs.arizona.edu (5.61/15) via SMTP
  3.     id AA13514; Fri, 11 Jan 91 05:56:10 -0700
  4. Received: from loria.crin.fr by inria.inria.fr (5.65+/90.0.9)
  5.     via Fnet-EUnet id AA09672; Fri, 11 Jan 91 13:55:31 +0100 (MET)
  6. Received: from quiche.crin.fr by loria.crin.fr (5.61/AFUU-2.0/LORIA-1.2), Fri, 11 Jan 91 13:53:58 +0100
  7. Date: Fri, 11 Jan 91 13:53:30 +0100
  8. Received: by quiche.crin.fr (4.1/AFUU-2.0/CRIN-1.1), Fri, 11 Jan 91 13:53:30 +0100
  9. From: thomas@loria.crin.fr (Laurent Thomas)
  10. Message-Id: <9101111253.AA24979@quiche.crin.fr>
  11. To: info-sr@cs.arizona.edu
  12. Subject: A naive question
  13.  
  14.  
  15. I just installed SR 1.1 on our SUNs and tried to write my first
  16. program. I looked at the examples and following the dinning philo. 
  17. solution I wrote :
  18.  
  19. resource ServOps
  20.    op passL ( p1 , p2 , p3 : int)  # WITH parameters
  21. end
  22. resource Servant
  23.    extend ServOps
  24. body Servant()
  25.    process server
  26.       var u,v,w : int
  27.       receive passL (u,v,w)
  28.    end
  29. end
  30. resource main
  31.    import ServOps,Servant
  32. body main()
  33.    initial
  34.       const n := 10
  35.       var s [1:n] : cap Servant
  36.       var si [1:n] : cap ServOps
  37.       fa i := 1 to n ->
  38.      s[i] := create Servant
  39.      si[i].passL := s[i].passL   # PROBLEM
  40.       af
  41.    end
  42. end
  43.  
  44. The only difference is that passL has arguments, when there are none
  45. in the philosopher problem. The compiler says :
  46.  
  47. sr -c essai.sr
  48. "essai.sr", line 21: warning: missing syntactic unit: (
  49. "essai.sr", line 21: fatal: invalid term in expression: .
  50. "essai.sr", line 21: warning: missing syntactic unit: )
  51. "essai.sr", line 21: fatal: signature mismatch: too many arguments
  52. "essai.sr", line 21: fatal: signature mismatch: assignment
  53. "essai.sr", line 21: fatal: invalid token ':=' at start of statement
  54. "essai.sr", line 23: warning: identifier declared but not used: si
  55. *** Error code 4
  56. make: Fatal error: Command failed for target `Interfaces/ServOps.i'
  57.  
  58. What am i missing ? (As in dinning/dinning.sr, i want to pass these
  59. operations between some of the s[i] resoures in order to simulate a
  60. fixed topology between them.)
  61. While reading previous messages from this mailing list, it appears
  62. that a new version is in preparation. Could we have some info upon
  63. its availability ?
  64.  
  65. Thanks.
  66.  
  67. Laurent Thomas 
  68. EMAIL : thomas@loria.crin.fr 
  69. POST : Centre de Recherche en Informatique de Nancy.
  70.        BP 239, 54506 Vandoeuvre-les-Nancy CEDEX, France
  71. FAX : 83413079
  72.  
  73. From gmt  Fri Jan 11 10:04:44 1991
  74. Received: from owl.cs.arizona.edu by megaron.cs.arizona.edu (5.61/15) via SMTP
  75.     id AA24008; Fri, 11 Jan 91 10:04:44 -0700
  76. Date: Fri, 11 Jan 91 10:04:43 MST
  77. From: "Gregg Townsend" <gmt>
  78. Message-Id: <9101111704.AA19166@owl.cs.arizona.edu>
  79. Received: by owl.cs.arizona.edu; Fri, 11 Jan 91 10:04:43 MST
  80. To: thomas@loria.crin.fr
  81. Subject: Re: A naive question
  82. Cc: info-sr
  83.  
  84. > [problems with an SR program]
  85.  
  86. You are missing the () on the create:  it should be
  87.     s[i] := create Servant()
  88.  
  89. However, the signature mismatch remains after fixing that;
  90. that appears to be a compiler bug.
  91.  
  92. > While reading previous messages from this mailing list, it appears
  93. > that a new version is in preparation. Could we have some info upon
  94. > its availability ?
  95.  
  96. We are making progress but are still a long way from completion.
  97. There are too many variables to make a good estimate, but it will
  98. be many months at a minimum even if everything goes well and we
  99. don't have too many other things to do.
  100.  
  101.     Gregg Townsend / Computer Science Dept / Univ of Arizona / Tucson, AZ 85721
  102.     +1 602 621 4325     gmt@cs.arizona.edu     110 57 16 W / 32 13 45 N / +758m
  103.  
  104. From u502sou@c1a.mpifr-bonn.mpg.de  Fri Feb  1 18:51:09 1991
  105. Received: from unido.informatik.uni-dortmund.de by megaron.cs.arizona.edu (5.61/15) via SMTP
  106.     id AA19672; Fri, 1 Feb 91 18:51:09 -0700
  107. Received: from mpifrrouter-x25a.extern.Uni-Dortmund.DE 
  108.     by unido.informatik.uni-dortmund.de with SMTP (UNIDO-2.0.3.e) via EUnet
  109.     for cs.arizona.edu
  110.     id AA23373; Fri, 1 Feb 91 13:44:43 GMT
  111. Received: from mpirbn.mpifr-bonn.mpg.de by mpifrrouter.mpifr-bonn.mpg.de (4.1/SMI-4.0)
  112.     id AA20544; Fri, 1 Feb 91 14:44:07 +0100
  113. Received: by mpirbn.mpifr-bonn.mpg.de (5.61/7.0)
  114.     id AA08045; Fri, 1 Feb 91 14:43:34 +0100
  115. To: info-sr@cs.arizona.edu
  116. Date: Fri, 1 Feb 91 14:09:26 +0100
  117. From: u502sou@c1a.mpifr-bonn.mpg.de (Ignatios Souvatzis)
  118. Sender: u502sou@c1a.mpifr-bonn.mpg.de
  119. Message-Id: <9102011309.AA06766@mpirbn.mpifr-bonn.mpg.de>
  120. Subject: I picked up SR by ftp.
  121. Reply-To: u502sou@c1a.mpifr-bonn.mpg.de
  122. Return-Receipt-To: u502sou@c1a.mpifr-bonn.mpg.de
  123. X-Mailer: GNU Emacs 18.51.0
  124.  
  125. I just (yesterday evening) picked up SR by ftp. I intend to use it to
  126. distribute a astronomical simulation program, which I am developing at
  127. the moment, over a couple of DECstations available at our site (and
  128. empty most of the nights).
  129.  
  130. In the file "mips.s", the author(s) write(s):
  131.  *  We don't save the floating point registers; they shouldn't be needed.
  132.  
  133. As I want to (mis)use the SR system to do distributed floating point
  134. calculations, (calling C or F77 workhorses as external functions) do I
  135. have to:
  136.  
  137.     1) wait for floating point SR?
  138.     2) modify mips.s to save them? (if yes, how?)
  139.     3) just use it (because the compilers saves them for me anyway)?
  140.  
  141. I don't want to 1) [thesis work...]
  142.     Ignatios Souvatzis
  143. --
  144. Paper mail: Ignatios Souvatzis, Radioastronomisches Institut der 
  145.             Universitaet Bonn, Auf dem Huegel 71, D-5300 Bonn 1, FRG
  146. Internet:   u502sou@mpirbn.mpifr-bonn.mpg.de
  147.  
  148. From angst@cs.uq.oz.au  Tue May 28 00:36:41 1991
  149. Received: from uqcspe.cs.uq.oz.au by optima.cs.arizona.edu (4.1/15)
  150.     id AA20594; Tue, 28 May 91 00:36:41 MST
  151. Received: from pawpaw.cs.uq.oz.au by uqcspe.cs.uq.oz.au 
  152.     id <AA12608@uqcspe.cs.uq.oz.au>; Tue, 28 May 91 17:36:34 +1000
  153. Message-Id: <9105280736.AA12608@uqcspe.cs.uq.oz.au>
  154. To: info-sr@cs.arizona.edu
  155. Subject: Assigning to resource/operation capability pointers (possible?)
  156. Date: Tue, 28 May 91 17:36:33 +1000
  157. From: Andrew Moran <angst@cs.uq.oz.au>
  158.  
  159.  
  160. I am trying to make an any ptr point to an operation capability (at the moment,
  161. but a resource capability could be needed/used).  I need to do this because of
  162. the mutually-recursive nature of a data structure I am using.
  163.  
  164. Is it legal SR to do this:
  165.  
  166.     optype OP ()
  167.     type OP_cap = cap OP
  168.  
  169.     ...
  170.  
  171.     op op_1 : OP
  172.  
  173.     proc some_proc (...)
  174.  
  175.         var op_1_ptr : ptr any
  176.  
  177.         var temp : ptr cap OP
  178.         temp := new(OP_cap)
  179.         temp^ := op_1
  180.  
  181.         op_1_ptr := temp
  182.  
  183.         some_other_proc (op_1_ptr) /* data constructor, takes an any ptr */
  184.  
  185.         ...
  186.  
  187.     end some_proc
  188.  
  189. The compiler tells me that there is a signature mismatch with the assignment
  190.  
  191.     temp^ := op_1
  192.  
  193. I know it's dodgy to use "type x = cap y" (as mentioned in the bugs handout),
  194. but new requires either a simple type or a type identifier.  I can't use
  195.  
  196.     var temp : ptr OP_cap
  197.  
  198. because the compiler crashes in sigcmp.c (line 127).
  199.  
  200. Can anyone help?
  201.  
  202. Andrew Moran
  203.  
  204. ---------
  205. "He's mad, totally mad.  He's madder than Mad Jack McMad, winner of last year's
  206.  Mr. Madman competition." -- Edmund, a butler.
  207. ----------------
  208.  
  209. From angst@cs.uq.oz.au  Tue May 28 05:41:30 1991
  210. Received: from uqcspe.cs.uq.oz.au by optima.cs.arizona.edu (4.1/15)
  211.     id AA01841; Tue, 28 May 91 05:41:30 MST
  212. Received: from pawpaw.cs.uq.oz.au by uqcspe.cs.uq.oz.au 
  213.     id <AA16096@uqcspe.cs.uq.oz.au>; Tue, 28 May 91 22:40:08 +1000
  214. Message-Id: <9105281240.AA16096@uqcspe.cs.uq.oz.au>
  215. To: info-sr@cs.arizona.edu
  216. Subject: Problem solved (was Re: Assigning to operation capability pointers)
  217. In-Reply-To: Your message of "Tue, 28 May 91 17:36:33 +1000."
  218. Date: Tue, 28 May 91 22:40:07 +1000
  219. From: Andrew Moran <angst@cs.uq.oz.au>
  220.  
  221.  
  222. Since sending my inquiry, I have solved the problem I had.  All I need to do is
  223. to enclose the capabilities in question in a record.  Then I can assign any
  224. ptrs easily and hide the caps as required.
  225.  
  226. Thanks to those who may respond before they see this,
  227.  
  228. Andrew Moran
  229.  
  230. ----------
  231. "It's about as impressive as Stumpy Oleg McNoleg's personal best in the Market
  232.  Harborough's Marathon." -- Lord Edmund Blackadder, loyalist
  233. -----------------
  234.  
  235. From angst@cs.uq.oz.au  Wed Jul  3 00:56:50 1991
  236. Received: from uqcspe.cs.uq.oz.au by optima.cs.arizona.edu (4.1/15)
  237.     id AA05293; Wed, 3 Jul 91 00:56:50 MST
  238. Received: from pawpaw.cs.uq.oz.au by uqcspe.cs.uq.oz.au 
  239.     id <AA25435@uqcspe.cs.uq.oz.au>; Wed, 3 Jul 91 17:56:37 +1000
  240. Message-Id: <9107030756.AA25435@uqcspe.cs.uq.oz.au>
  241. To: info-sr@cs.arizona.edu
  242. Subject: Problem with data locking mechanism
  243. Date: Wed, 03 Jul 91 17:56:36 +1000
  244. From: Andrew Moran <angst@cs.uq.oz.au>
  245.  
  246.  
  247. Some of you may recall an earlier query of mine about mechanisms for enforcing
  248. mutual exclusion on data.  I have had to revise the solution supplied by Ron
  249. Olsson because my needs are slightly more complex than originally thought.
  250.  
  251. To recap, we associate three semaphore-like operations with each instance of
  252. the data in question: one for requesting locks (req_lock), one for releasing
  253. locks (rel_lock) and one for freeing the lock operations (free_ops).  When the
  254. lock record is created, an instance of each of these operations hangs around
  255. and is served as in new_lock below:
  256.  
  257.     op lock (v : ptr VALUE)
  258.     op unlock (v : ptr VALUE)
  259.     op new_lock () returns l : ptr LOCK
  260.  
  261.     proc lock (v)
  262.         call v^.v_lock^.l_req_lock ()
  263.     end lock
  264.  
  265.     proc unlock (v)
  266.         send v^.v_lock^.l_rel_lock ()
  267.         if v^.v_lock^.l_free_ops () ->
  268.         v^.v_lock := null
  269.         fi
  270.     end unlock
  271.  
  272.     proc new_lock () returns l
  273.         op req_lock, rel_lock : LockSem
  274.         op free_ops : FreeSem
  275.  
  276.         l := new(LOCK)
  277.         l^.l_req_lock := req_lock
  278.         l^.l_rel_lock := rel_lock
  279.         l^.l_free_ops := free_ops
  280.  
  281.         reply
  282.         send rel_lock ()
  283.  
  284.         do true ->
  285.         write (stderr, "Entering lock loop")
  286.         flush (stderr) ; nap (1000)
  287.  
  288.         in req_lock () ->
  289.             write (stderr, "Lock requested")
  290.             flush (stderr) ; nap (1000)
  291.             receive rel_lock ()
  292.             write (stderr, "Lock gained")
  293.             flush (stderr) ; nap (1000)
  294.         [] free_ops () returns freed ->
  295.             write (stderr, "Lock free ops called")
  296.             flush (stderr) ; nap (1000)
  297.  
  298.             if ((? rel_lock) > 0) & ((? req_lock) = 0) ->
  299.             write (stderr, "Lock operations freed")
  300.             flush (stderr) ; nap (1000)
  301.             freed := true
  302.             exit
  303.             [] else ->
  304.             write (stderr, "Lock operations not freed")
  305.             flush (stderr) ; nap (1000)
  306.             freed := false
  307.             fi
  308.         ni
  309.         od
  310.     end new_lock
  311.  
  312. Note the cumbersome diagnostic writes.  These operations are part of a much
  313. larger system, a parallel functional abstract machine.
  314.  
  315. This compiles fine, but when run produces this output:
  316.  
  317. > Entering lock loop
  318. > Lock requested
  319. > Lock gained
  320. > Entering lock loop
  321. > signal SEGV (no mapping at the fault address) in memcpy at 0xdd7e40e
  322. > memcpy+0x26:            movb    a0@+,a1@+
  323.  
  324. Using dbx, we find out "where":
  325.  
  326. > (dbx) where
  327. > memcpy(0x8ba20, 0x8ba58, 0x90178, 0x0) at 0xdd7e40e
  328. > sr_invoke(ibp = 0x90178), line 126 in "invoke.c"
  329. > `address`Plock(rp = 0x8ba20 "", rv = 0x8ba58 "^A", pb = 0x90178 "", wc = 0), line 400 in "address.c"
  330. > sr_invoke(ibp = 0x90120), line 126 in "invoke.c"
  331.  
  332. So one invocation of req_lock is allowed and then something happens.  Is this a
  333. symptom of something obvious that the gurus have seen before ... or is it more
  334. insidious?
  335.  
  336. Thanks for your help,
  337.  
  338. Andrew
  339.  
  340. ---------
  341. "He's mad, mad.  He's madder than Mad Jack McMad, winner of last year's
  342.  Mr. Madman competition." -- Edmund, a butler.
  343. ----------------
  344.  
  345. From ntmtv!daemon@ames.arc.nasa.gov  Wed Jul 10 16:42:22 1991
  346. Received: from ames.arc.nasa.gov by optima.cs.arizona.edu (4.1/15)
  347.     id AA18406; Wed, 10 Jul 91 16:42:22 MST
  348. Received: by ames.arc.nasa.gov (5.65b/1.2); Wed, 10 Jul 91 16:42:20 -0700
  349. Received: by ntmtv.com (3.2/SMI-3.2)
  350.     id AA10447; Wed, 10 Jul 91 15:58:51 PDT
  351. Date: Wed, 10 Jul 91 15:58:51 PDT
  352. From: ntmtv!daemon@ames.arc.nasa.gov
  353. Message-Id: <9107102258.AA10447@ntmtv.com>
  354. To: ames!info-sr@cs.arizona.edu
  355.  
  356. Received: from ariel. by ntmtv.com (3.2/SMI-3.2)
  357.     id AA10441; Wed, 10 Jul 91 15:58:48 PDT
  358. Received: by ariel. (4.0/SMI-4.0)
  359.     id AA05231; Wed, 10 Jul 91 15:57:29 PDT
  360. Date: Wed, 10 Jul 91 15:57:29 PDT
  361. From: hildum@ariel (Eric Hildum)
  362. Message-Id: <9107102257.AA05231@ariel.>
  363. To: info-sr@cs.arizona.edu
  364. Subject: SR 2.0?
  365.  
  366.  
  367. What has happened to SR 2.0? I thought that was to be out last year, but have
  368. not heard anything...
  369.  
  370.  
  371.                 Eric
  372.  
  373. From gmt  Thu Jul 11 10:05:38 1991
  374. Received: from owl.cs.arizona.edu by optima.cs.arizona.edu (4.1/15)
  375.     id AA23121; Thu, 11 Jul 91 10:05:38 MST
  376. Date: Thu, 11 Jul 91 10:05:37 MST
  377. From: "Gregg Townsend" <gmt>
  378. Message-Id: <9107111705.AA02839@owl.cs.arizona.edu>
  379. Received: by owl.cs.arizona.edu; Thu, 11 Jul 91 10:05:37 MST
  380. To: info-sr
  381. Subject: Re: SR 2.0?
  382.  
  383.     From: hildum@ariel (Eric Hildum)
  384.  
  385.     What has happened to SR 2.0?  I thought that was to be out last year,
  386.     but have not heard anything...
  387.  
  388.  
  389. We are actively working on SR version 2 and hope to release it before the
  390. end of this year.  We did underestimate the task, and any dream of finishing
  391. it in 1990 was unrealistic.  Stay tuned to this mailing list for further
  392. information.
  393.  
  394.     Gregg Townsend / Computer Science Dept / Univ of Arizona / Tucson, AZ 85721
  395.     +1 602 621 4325     gmt@cs.arizona.edu     110 57 16 W / 32 13 45 N / +758m
  396.  
  397. From angst@cs.uq.oz.au  Fri Jul 26 22:45:37 1991
  398. Received: from uqcspe.cs.uq.oz.au by optima.cs.arizona.edu (4.1/15)
  399.     id AA02106; Fri, 26 Jul 91 22:45:37 MST
  400. Received: from zinnia.cs.uq.oz.au by uqcspe.cs.uq.oz.au 
  401.     id <AA28429@uqcspe.cs.uq.oz.au>; Sat, 27 Jul 91 15:45:32 +1000
  402. Message-Id: <9107270545.AA28429@uqcspe.cs.uq.oz.au>
  403. To: info-sr@cs.arizona.edu
  404. Subject: Broadcasting in SR
  405. Date: Sat, 27 Jul 91 15:45:31 +1000
  406. From: Andrew Moran <angst@cs.uq.oz.au>
  407.  
  408.  
  409. I have an application for broadcasting, i.e. an unknown number of clients wish
  410. to know when an event has occurred.  If the event has already occurred when
  411. they ask, they should be told anyway.
  412.  
  413. This is what I came up with:
  414.  
  415.     resource R
  416.  
  417.     op Start ()
  418.     op Wait ()
  419.     op Fini ()
  420.  
  421.     ...
  422.  
  423.     body R ()
  424.  
  425.     ...
  426.  
  427.     proc Start ()
  428.         finito := false
  429.         send Waiting ()
  430.  
  431.         ...
  432.  
  433.     end Start
  434.  
  435.     ...
  436.  
  437.     proc Waiting ()
  438.         in Wait () ->
  439.         if finito ->
  440.             send Waiting ()
  441.         [] else ->
  442.             call Waiting ()
  443.         fi
  444.         [] Fini () ->
  445.         finito := true
  446.         send Waiting ()
  447.         ni
  448.     end Waiting
  449.  
  450.     ...
  451.  
  452.     end R
  453.  
  454. Instances of R can wait upon other instances of R.
  455.  
  456. Initially, each instance starts the Waiting operation, so it now has a process
  457. waiting to serve invocations of Wait and Fini.  To wait for an instance to
  458. finish, you call R_i.Wait ().  When an instance is finished its work, it calls
  459. Fini ().
  460.  
  461. So we can build up a stack of invocations of Wait, each hanging on until the
  462. next one finishes.  When Fini is called, the in statement at that level will
  463. terminate, as will the invocation of Waiting at that level.  Thus each call to
  464. Wait will finish as its invocation of Waiting does.
  465.  
  466. Note that Fini (and Wait when the work is done, i.e. finito is true) invokes
  467. Waiting with a send.  This is to allow the instance to be waited upon for its
  468. entire lifespan, even after it has called Fini.
  469.  
  470. Can anyone see any problems with this approach?  Or any improvements?
  471.  
  472. On a tangential note, could this error:
  473.  
  474.     signal BUS (alignment error) in sr_finished_input ()
  475.  
  476. merely require an increase in one of the run time maxima or is it likely to
  477. be a more serious flaw?  It occurs when I incorporate the above broadcasting
  478. into my larger system.  The broadcasting works perfectly when
  479. tested on its own.  In the larger system, R is an execution resource, which
  480. implements an abstract machine.  A parent execution instance is waiting on two
  481. children, with this code:
  482.  
  483.     proc WaitForArgs (lower, upper)
  484.     fa mach := lower to upper ->
  485.         arg_exec [mach].Wait ()
  486.     af
  487.  
  488.     fa mach := lower to upper ->
  489.         destroy arg_exec [mach] ; arg_exec [mach] := noop
  490.     af
  491.     end WaitForArgs
  492.  
  493. where lower and upper are bounds of the interval of the array of child
  494. execution instances for which we wish to wait.  When this is used by a parent
  495. to wait for two children, it invokes Wait () for the first, and then halts with
  496. the above error.  The sr_finished_input () is called from within PWaiting (),
  497. so I can only assume it has something to do with the broadcasting method.
  498. However, I cannot reproduce the error in the test model (i.e. the one without
  499. actual execution).  I have taken great pains to ensure that all communication
  500. is as close to the error case as possible, but it runs perfectly.
  501.  
  502. So, once again, I make my pathetic plea to the SR community:
  503.  
  504.     Help?
  505.  
  506. Thanks,
  507.  
  508. Andrew
  509.  
  510. ---------
  511.   Lt. G: "If we do happen to stand on a mine, sir, what do we do ?"
  512. Capt. B: "Normal procedure, Lieutenant, is to jump 200 feet into the air
  513.       and scatter oneself over a wide area."
  514.  
  515.     -- somewhere in no man's land, "Blackadder Goes Forth"
  516. ---------------
  517.  
  518. From greg  Sun Jul 28 14:34:15 1991
  519. Date: Sun, 28 Jul 91 14:34:15 MST
  520. From: "Greg Andrews" <greg>
  521. Message-Id: <9107282134.AA00352@optima.cs.arizona.edu>
  522. Received: by optima.cs.arizona.edu (4.1/15)
  523.     id AA00352; Sun, 28 Jul 91 14:34:15 MST
  524. To: angst@cs.uq.oz.au, info-sr@cs.arizona.edu
  525. Subject: Re:  Broadcasting in SR
  526.  
  527.     Subject: Broadcasting in SR
  528.     Date: Sat, 27 Jul 91 15:45:31 +1000
  529.     From: Andrew Moran <angst@cs.uq.oz.au>
  530.  
  531.     I have an application for broadcasting, i.e. an unknown number of clients wish
  532.     to know when an event has occurred.  If the event has already occurred when
  533.     they ask, they should be told anyway.
  534.  
  535.     This is what I came up with: ...
  536.  
  537. I'm not sure I fully understand what you are trying to do, but your
  538. approach looks much more cumbersome (and inefficient) than I think
  539. is required.  If I do understand correctly, the following is sufficient:
  540.  
  541.         resource R
  542.  
  543.         op Wait ()
  544.         op Fini ()
  545.         ...
  546.  
  547.         body R ()
  548.  
  549.         process Waiting
  550.             receive Fini()  # wait for finished signal
  551.             do true ->
  552.                 receive Wait()  # awaken all processes who are waiting
  553.                                 # now or call Wait() later
  554.             od
  555.         end
  556.  
  557.         end
  558.  
  559. This can be used only once.  However, if you know how many processes will
  560. call Wait(), you can embed the body of Waiting in a "do true" loop and
  561. change the inner loop to terminate after enough calls of Wait have been
  562. received.  I don't see any need for a finito flag variable.
  563.  
  564.     On a tangential note, could this error:
  565.  
  566.         signal BUS (alignment error) in sr_finished_input ()
  567.  
  568.     merely require an increase in one of the run time maxima or is it likely to
  569.     be a more serious flaw?
  570.  
  571. Not likely.  However, someone else will have to explain what triggers
  572. this message.
  573.  
  574. -- Greg Andrews
  575.  
  576. From angst@cs.uq.oz.au  Sun Jul 28 19:31:14 1991
  577. Received: from uqcspe.cs.uq.oz.au by optima.cs.arizona.edu (4.1/15)
  578.     id AA09284; Sun, 28 Jul 91 19:31:14 MST
  579. Received: from zinnia.cs.uq.oz.au by uqcspe.cs.uq.oz.au 
  580.     id <AA21904@uqcspe.cs.uq.oz.au>; Mon, 29 Jul 91 12:31:08 +1000
  581. Message-Id: <9107290231.AA21904@uqcspe.cs.uq.oz.au>
  582. To: info-sr@cs.arizona.edu
  583. Subject: Re: Broadcasting in SR 
  584. In-Reply-To: Your message of "Sun, 28 Jul 91 14:34:15 MST."
  585.              <9107282134.AA00352@optima.cs.arizona.edu> 
  586. Date: Mon, 29 Jul 91 12:31:07 +1000
  587. From: Andrew Moran <angst@cs.uq.oz.au>
  588.  
  589.  
  590. > This can be used only once.  However, if you know how many processes will
  591. > call Wait(), you can embed the body of Waiting in a "do true" loop and
  592. > change the inner loop to terminate after enough calls of Wait have been
  593. > received.  I don't see any need for a finito flag variable.
  594.  
  595. The flag is needed because a resource may need do perform its action more
  596. than once; i.e. Fini may be called more than once.  I use finito to reset the
  597. state of operation Waiting.
  598.  
  599. > -- Greg Andrews
  600.  
  601. Andrew Moran
  602.  
  603. ----------
  604. "It's about as impressive as Stumpy Oleg McNoleg's personal best in the Market
  605.  Harbourer's Marathon." -- Lord Edmund Blackadder, loyalist
  606. -----------------
  607.  
  608. From angst@cs.uq.oz.au  Mon Jul 29 17:34:27 1991
  609. Received: from uqcspe.cs.uq.oz.au by optima.cs.arizona.edu (4.1/15)
  610.     id AA26640; Mon, 29 Jul 91 17:34:27 MST
  611. Received: from zinnia.cs.uq.oz.au by uqcspe.cs.uq.oz.au 
  612.     id <AA11389@uqcspe.cs.uq.oz.au>; Tue, 30 Jul 91 10:34:21 +1000
  613. Message-Id: <9107300034.AA11389@uqcspe.cs.uq.oz.au>
  614. To: info-sr@cs.arizona.edu
  615. Subject: Re: Broadcasting in SR 
  616. In-Reply-To: Your message of "Mon, 29 Jul 91 08:46:49 MST."
  617.              <9107291546.AA09109@owl.cs.arizona.edu> 
  618. Date: Tue, 30 Jul 91 10:34:20 +1000
  619. From: Andrew Moran <angst@cs.uq.oz.au>
  620.  
  621.  
  622. > It sounds like an address pointer somewhere may have been clobbered, possibly
  623. > due to a store outside array bounds or something like that.
  624.  
  625. I think it had something to do with timing because when I removed diagnostic
  626. writes (they were writing to files) it worked!  So my system, as it was, was
  627. very vulnerable to timing changes.
  628.  
  629. Is this a common problem?  Or is it flawed design?
  630.  
  631. >     Gregg Townsend
  632.  
  633. Andrew Moran
  634.  
  635. --------
  636. "Men can't deal with commitment.  They're afraid they'll get married and then 
  637.  meet the woman of their dreams at the reception." -- Carrie Snow
  638. -------------
  639.  
  640. From gmt  Mon Jul 29 18:45:45 1991
  641. Received: from owl.cs.arizona.edu by optima.cs.arizona.edu (4.1/15)
  642.     id AA29369; Mon, 29 Jul 91 18:45:45 MST
  643. Date: Mon, 29 Jul 91 18:45:42 MST
  644. From: "Gregg Townsend" <gmt>
  645. Message-Id: <9107300145.AA10165@owl.cs.arizona.edu>
  646. Received: by owl.cs.arizona.edu; Mon, 29 Jul 91 18:45:42 MST
  647. To: angst@cs.uq.oz.au, info-sr@cs.arizona.edu
  648. Subject: Re: Broadcasting in SR
  649.  
  650. I don't recall seeing an alignment error before, so I don't think that
  651. particular problem is common.  That is not to say that SR is without bugs,
  652. but it could also be caused by a bad array index in the user code.
  653.  
  654.     Gregg Townsend / Computer Science Dept / Univ of Arizona / Tucson, AZ 85721
  655.     +1 602 621 4325     gmt@cs.arizona.edu     110 57 16 W / 32 13 45 N / +758m
  656.  
  657. From angst@cs.uq.oz.au  Mon Jul 29 19:59:39 1991
  658. Received: from uqcspe.cs.uq.oz.au by optima.cs.arizona.edu (4.1/15)
  659.     id AA01528; Mon, 29 Jul 91 19:59:39 MST
  660. Received: from zinnia.cs.uq.oz.au by uqcspe.cs.uq.oz.au 
  661.     id <AA14816@uqcspe.cs.uq.oz.au>; Tue, 30 Jul 91 12:59:35 +1000
  662. Message-Id: <9107300259.AA14816@uqcspe.cs.uq.oz.au>
  663. To: "Gregg Townsend" <gmt@cs.arizona.edu>
  664. Cc: info-sr@cs.arizona.edu
  665. Subject: Re: Broadcasting in SR 
  666. In-Reply-To: Your message of "Mon, 29 Jul 91 18:45:42 MST."
  667.              <9107300145.AA10165@owl.cs.arizona.edu> 
  668. Date: Tue, 30 Jul 91 12:59:35 +1000
  669. From: Andrew Moran <angst@cs.uq.oz.au>
  670.  
  671.  
  672. > I don't recall seeing an alignment error before, so I don't think that
  673. > particular problem is common.  That is not to say that SR is without bugs,
  674. > but it could also be caused by a bad array index in the user code.
  675.  
  676. Yeah, I'll look into it (certainly, I have arrays of resource caps, but I'm
  677. fairly sure everything was fine there).  Is it possible that the file I/O
  678. clobberred some global somewhere?  I was using sprintf as an external also.
  679.  
  680. If I track it down, I'll be sure to let you know.
  681.  
  682. >     Gregg Townsend
  683.  
  684. Thanks for your help,
  685.  
  686. Andrew Moran
  687.  
  688. ----------
  689. "It's about as impressive as Stumpy Oleg McNoleg's personal best in the Market
  690.  Harbourer's Marathon." -- Lord Edmund Blackadder, loyalist
  691. -----------------
  692.  
  693. From thomas@quiche.crin.fr  Thu Aug 22 07:42:10 1991
  694. Received: from quiche.crin.fr by optima.cs.arizona.edu (4.1/15)
  695.     id AA23947; Thu, 22 Aug 91 07:42:10 MST
  696. Received: by quiche.crin.fr id AA15480
  697.   (5.65c+/IDA-1.4.3 for info-sr@cs.arizona.edu); Thu, 22 Aug 91 14:47:37 +0200
  698. From: Laurent Thomas <Laurent.Thomas@loria.crin.fr>
  699. Message-Id: <9108221247.AA15480@quiche.crin.fr>
  700. Subject: mutually recursive type
  701. To: info-sr@cs.arizona.edu
  702. Date: Thu, 22 Aug 91 14:47:24 MET DST
  703. X-Mailer: ELM [version 2.3 PL11]
  704.  
  705. I want to define mutually recursive types :
  706.     type x = rec ( ...; y : z ; ... )
  707.     optype z ( one_x : x )
  708. As said in the reference manual this is not allowed. So i say :
  709.     type x = rec ( ...; y : ptr any ; ... )
  710.     optype z ( one_x : x )
  711.  
  712. and somewhere in a resource :
  713.  
  714.     op d : z
  715.     proc d ( one_x )
  716.       var p : ptr cap z
  717.       p := one_x.y        
  718.       send p^( one_x )    # fatal: signature mismatch: invoke
  719.         end
  720.  
  721. However if i define :
  722.     
  723.     type dummy = rec ( a_z : cap z )
  724.     proc d ( one_x )
  725.       var p : ptr dummy
  726.       p := one_x.y        
  727.       send p^.a_z( one_x )    # it compiles fine !!!
  728.         end
  729.  
  730. What the hell am i missing ?
  731.  
  732. Laurent Thomas 
  733. EMAIL : thomas@loria.crin.fr 
  734. POST : Centre de Recherche en Informatique de Nancy.
  735.        Campus Universitaire. BP 239.
  736.        F-54506 Vandoeuvre-les-Nancy CEDEX, France
  737. FAX : 83413079
  738.  
  739. From gmt  Thu Aug 22 08:29:59 1991
  740. Received: from owl.cs.arizona.edu by optima.cs.arizona.edu (4.1/15)
  741.     id AA25680; Thu, 22 Aug 91 08:29:59 MST
  742. Date: Thu, 22 Aug 91 08:29:55 MST
  743. From: "Gregg Townsend" <gmt>
  744. Message-Id: <9108221529.AA23810@owl.cs.arizona.edu>
  745. Received: by owl.cs.arizona.edu; Thu, 22 Aug 91 08:29:55 MST
  746. To: Laurent.Thomas@loria.crin.fr, info-sr@cs.arizona.edu
  747. Subject: Re:  mutually recursive type
  748.  
  749. I don't think you're missing anything there.  It looks like a bug to me.
  750. That sort of signature problem was one of the motivations for the rewrite
  751. of the SR compiler that is now in progress.
  752.  
  753.     Gregg Townsend / Computer Science Dept / Univ of Arizona / Tucson, AZ 85721
  754.     +1 602 621 4325     gmt@cs.arizona.edu     110 57 16 W / 32 13 45 N / +758m
  755.  
  756. From shartley@king.mcs.drexel.edu  Sun Sep 29 15:25:13 1991
  757. Received: from mcs.drexel.edu (king.mcs.drexel.edu) by optima.cs.arizona.edu (4.1/15)
  758.     id AA18553; Sun, 29 Sep 91 15:25:13 MST
  759. Received: by mcs.drexel.edu (4.1/SMI-4.0)
  760.     id AA28273; Sun, 29 Sep 91 18:20:30 EDT
  761. Date: Sun, 29 Sep 91 18:20:30 EDT
  762. From: shartley@king.mcs.drexel.edu (Stephen J. Hartley)
  763. Message-Id: <9109292220.AA28273@mcs.drexel.edu>
  764. To: info-sr@cs.arizona.edu
  765. Subject: Sequent code
  766.  
  767.   We have a Sequent (i386 CPU's) running DYNIX V3.0.17.9 and I would like to
  768. run SR on it.  Has anybody written the necessary rts/sequent.s module?
  769.   Thanks for your help.
  770.  
  771. Stephen J. Hartley, Visiting Assistant Professor, office ph: (215) 895-2668
  772. Math and Computer Science, Drexel University, Philadelphia, PA  19104
  773. shartley@mcs.drexel.edu
  774.  
  775. From shartley@king.mcs.drexel.edu  Sun Sep 29 17:22:57 1991
  776. Received: from mcs.drexel.edu (king.mcs.drexel.edu) by optima.cs.arizona.edu (4.1/15)
  777.     id AA21936; Sun, 29 Sep 91 17:22:57 MST
  778. Received: by mcs.drexel.edu (4.1/SMI-4.0)
  779.     id AA01875; Sun, 29 Sep 91 20:18:13 EDT
  780. Date: Sun, 29 Sep 91 20:18:13 EDT
  781. From: shartley@king.mcs.drexel.edu (Stephen J. Hartley)
  782. Message-Id: <9109300018.AA01875@mcs.drexel.edu>
  783. To: greg@cs.arizona.edu
  784. Subject: SR concurrency
  785. Cc: info-sr@cs.arizona.edu
  786.  
  787.   By playing around with the following program on an Encore available to me
  788. (amax.npac.syr.edu), I have been able to determine that multiple SR processes
  789. within the same virtual machine are run in one UNIX process (using one of
  790. the CPU's) with apparent or simulated concurrency, i.e. SR's own scheduler
  791. switches the CPU among the SR processes in the virtual machine.  Two processes
  792. in separate virtual machines operate with true concurrency on different Encore
  793. CPU's.  But the SR processes in the latter case cannot share any data (version
  794. 1.1 of SR).  So on the Encore, SR does not facilitate shared memory multiple
  795. CPU programming to the extent that it could.
  796.   Will the next version of SR let multiple SR processes in the same virtual
  797. machine use multiple physical CPU's (threadlike)?
  798.  
  799. Stephen J. Hartley, Visiting Assistant Professor, office ph: (215) 895-2668
  800. Math and Computer Science, Drexel University, Philadelphia, PA  19104
  801. shartley@mcs.drexel.edu
  802. ------------------------------------------------------------------------------
  803.  
  804. resource TestOp
  805.     op ReadyToGo(machine_num : int) {send}
  806. end TestOp
  807.  
  808. resource Helper
  809.     import TestOp
  810.     op SignalToStart() {send}
  811.  
  812. body Helper(machine_num : int; qcap : cap TestOp)
  813.     var sum : int
  814.  
  815.     initial
  816.         write("Helper", machine_num, "starting up")
  817.         flush(stdout)
  818.     end initial
  819.  
  820.     process do_it
  821.         send qcap.ReadyToGo(machine_num)
  822.         receive SignalToStart()
  823.         sum := 0
  824. # spin for a few seconds
  825.         fa i := 1 to 1000000 -> sum := sum + 1 af
  826.         send qcap.ReadyToGo(machine_num)
  827.         write("Helper", machine_num, "finished at", age(), "ms")
  828.         flush(stdout)
  829.     end do_it
  830.  
  831. end Helper
  832.  
  833. resource Test
  834.     extend TestOp
  835.     import Helper
  836.  
  837. body Test()
  838.  
  839.     process main
  840.         var num_machines : int := 3
  841.         var machine_num : int
  842.     
  843.         var machine_cap[1:num_machines] : cap vm
  844.         var Helper_cap[1:num_machines] : cap Helper
  845.         var my_cap : cap Test
  846.     
  847.         my_cap := myresource()
  848.     
  849.         fa i := 1 to num_machines ->
  850.             machine_cap[i] := create vm()
  851.         af
  852.  
  853.         fa i := 1 to num_machines ->
  854.             Helper_cap[i] := create Helper(i, my_cap)
  855. # Pick one of the following two and comment out the other.
  856.                 on machine_cap[1]
  857. #                on machine_cap[i]
  858.         af
  859.     
  860.         fa r := 1 to num_machines ->
  861.             receive ReadyToGo(machine_num)
  862.             send Helper_cap[machine_num].SignalToStart()
  863.         af
  864.  
  865.         fa i := 1 to num_machines ->
  866.             receive ReadyToGo(machine_num)
  867.         af
  868.         write("Done")
  869.     end main
  870. end Test
  871.  
  872. From greg  Mon Sep 30 08:45:17 1991
  873. Received: from paloverde.cs.arizona.edu by optima.cs.arizona.edu (4.1/15)
  874.     id AA26818; Mon, 30 Sep 91 08:45:17 MST
  875. Date: Mon, 30 Sep 91 08:45:17 MST
  876. From: "Greg Andrews" <greg>
  877. Message-Id: <9109301545.AA19694@paloverde.cs.arizona.edu>
  878. Received: by paloverde.cs.arizona.edu; Mon, 30 Sep 91 08:45:17 MST
  879. To: shartley@king.mcs.drexel.edu
  880. Subject: Re:  SR concurrency
  881. Cc: info-sr
  882.  
  883.     Date: Sun, 29 Sep 91 20:18:13 EDT
  884.     From: shartley@king.mcs.drexel.edu (Stephen J. Hartley)
  885.     Subject: SR concurrency
  886.  
  887.       By playing around with the following program on an Encore available to me
  888.     (amax.npac.syr.edu), I have been able to determine that multiple SR processes
  889.     within the same virtual machine are run in one UNIX process (using one of
  890.     the CPU's) with apparent or simulated concurrency, i.e. SR's own scheduler
  891.     switches the CPU among the SR processes in the virtual machine.  Two processes
  892.     in separate virtual machines operate with true concurrency on different Encore
  893.     CPU's.  But the SR processes in the latter case cannot share any data (version
  894.     1.1 of SR).  So on the Encore, SR does not facilitate shared memory multiple
  895.     CPU programming to the extent that it could.
  896.  
  897. You are correct.  We have a multiprocessor version of SR here for
  898. our Sequent multiprocessor.  Also, Ron Olsson and a student have an
  899. Encore version at UC Davis, but I don't know the current status
  900. of that.  Contact olsson@cs.ucdavis.edu to inquire.
  901.  
  902.       Will the next version of SR let multiple SR processes in the same virtual
  903.     machine use multiple physical CPU's (threadlike)?
  904.  
  905. Neither multiprocessor version is an "official" part of the
  906. current SR distribution, but we hope to have them as part of the
  907. distribution of version 2.0.
  908.  
  909. -- Greg Andrews
  910.  
  911. From gmt  Mon Sep 30 09:27:11 1991
  912. Received: from owl.cs.arizona.edu by optima.cs.arizona.edu (4.1/15)
  913.     id AA28393; Mon, 30 Sep 91 09:27:11 MST
  914. Date: Mon, 30 Sep 91 09:27:10 MST
  915. From: "Gregg Townsend" <gmt>
  916. Message-Id: <9109301627.AA17940@owl.cs.arizona.edu>
  917. Received: by owl.cs.arizona.edu; Mon, 30 Sep 91 09:27:10 MST
  918. To: info-sr@cs.arizona.edu, shartley@king.mcs.drexel.edu
  919. Subject: Sequent context switch code
  920.  
  921. Here is a context switch routine for the Intel 386 architecture.
  922.  
  923.     Gregg Townsend / Computer Science Dept / Univ of Arizona / Tucson, AZ 85721
  924.     +1 602 621 4325     gmt@cs.arizona.edu     110 57 16 W / 32 13 45 N / +758m
  925.  
  926.  
  927.  
  928.  
  929. /*  i386.s - intel 80386 context switching code for Sequent Symmetry
  930.  *
  931.  *  (This should work also for other Intel 80386 machines if they use the same
  932.  *   calling sequences and register conventions.)
  933.  *
  934.  *  A context array is laid out like this:
  935.  *
  936.  *    saved registers (%ebp, %ebx, %esi, %edi)
  937.  *      magic word for checking integrity
  938.  *    unused stack space
  939.  *    saved %esp            <--- saved ebp points here
  940.  *    saved pc (return address)
  941.  *    error routine addr (if code returns, which is an error, it will go here)
  942.  *    arguments from sr_build_context call
  943.  *
  944.  *  Registers %ebp, %ebx, %esi, and %edi are saved at the base of the array.
  945.  *  %eax, %ecx, and %edx aren't saved because C doesn't expect them to survive
  946.  *  over function calls.  %esp is saved on the stack at subroutine entry.
  947.  */
  948.  
  949. #define MAGIC 79797979         /* any unlikely long integer */
  950. #define RSIZE 16        /* size of register save area */
  951.  
  952.  
  953.  
  954.     .data
  955.     .align 2
  956.  
  957. dummy_stack:             /* fake initial context */
  958.     .long    0          /* 00 offset - %ebp */
  959.     .long    0          /* 04 offset - %ebx */
  960.     .long    0          /* 08 offset - %esi*/
  961.     .long     0          /* 12 offset - %edi */
  962.     .long    MAGIC       /* 16 offset - magic word for sanity check */
  963.  
  964. curr_stack:            /* saves addr of current context (stack) */
  965.     .long    dummy_stack
  966.  
  967.     .text
  968.     .align 2
  969.  
  970.  
  971.  
  972. /*  sr_build_context(code,buf,bufsize,a1,a2,a3,a4) -- create a new context.
  973.  *
  974.  *  code     entry point of the code to be executed in the context
  975.  *  buf         buffer for holding the context array
  976.  *  bufsize     size of the buffer
  977.  *  a1 - a4     four int-sized arguments to be passed to the code
  978.  */
  979.  
  980.     .globl    _sr_build_context
  981.  
  982. _sr_build_context:
  983.     pushl    %ebp         /* save caller's frame pointer */
  984.     movl    %esp,%ebp    /* save caller's stack pointer */
  985.  
  986.     movl    12(%ebp), %eax    /* %eax = pointer to context array */
  987.     movl    %eax, %esp
  988.     addl    16(%ebp), %esp    /* point stack to end of context array */
  989.  
  990.     pushl    32(%ebp)    /* push arg4 */
  991.     pushl    28(%ebp)    /* push arg3 */
  992.     pushl    24(%ebp)    /* push arg2 */
  993.     pushl    20(%ebp)    /* push arg1 */
  994.     pushl    $under        /* push error addr in case context returns */
  995.     pushl    8(%ebp)        /* push address for startind execution */
  996.     pushl    $0        /* push dummy frame pointer */
  997.  
  998.     movl    %esp, (%eax)    /* set initial frame pointer*/
  999.     movl    $MAGIC, RSIZE(%eax)  /* store magic word for integrity check */
  1000.  
  1001.     leave            /* restore stack and frame pointers */
  1002.     ret            /* return */
  1003.  
  1004.  
  1005.  
  1006. /*  sr_chg_context(newstack) -- switch context to the specified stack  */
  1007.  
  1008.     .globl    _sr_chg_context
  1009. _sr_chg_context:
  1010.     pushl    %ebp        /* save old frame pointer */
  1011.     movl    %esp,%ebp    /* save old stack pointer in frame pointer */
  1012.  
  1013.     movl    curr_stack,%eax    /* load address of current context stack */
  1014.     movl    %ebp,  0(%eax)    /* save registers in user context block */
  1015.     movl    %ebx,  4(%eax)
  1016.     movl    %esi,  8(%eax)
  1017.     movl    %edi, 12(%eax)
  1018.  
  1019.     addl    $RSIZE,%eax
  1020.     cmpl    %eax,%esp    /* check that stack isn't overflowing */
  1021.     jle    over
  1022.     cmpl    $MAGIC,(%eax)    /* catch earlier overflow (maybe) */
  1023.     jne    over
  1024.  
  1025.     movl    8(%ebp), %eax    /* load address of new context */
  1026.     cmpl    $MAGIC, RSIZE(%eax)    /* make sure new stack looks okay */
  1027.     jne    bad
  1028.  
  1029.     movl    %eax, curr_stack /* save address of new context */
  1030.     movl     0(%eax), %ebp    /* load registers for new context */
  1031.     movl     4(%eax), %ebx
  1032.     movl     8(%eax), %esi
  1033.     movl    12(%eax), %edi
  1034.  
  1035.     leave            /* restore %esp and %ebp */
  1036.     ret            /* return into new context */
  1037.  
  1038.  
  1039.  
  1040. /*  sr_check_stk() -- check that the stack is not overflowing  */
  1041.  
  1042.     .globl    _sr_check_stk
  1043. _sr_check_stk:
  1044.     movl    curr_stack, %eax
  1045.     addl    $RSIZE, %eax
  1046.     cmpl    %eax, %esp
  1047.     jle    over
  1048.     ret
  1049.  
  1050.  
  1051.  
  1052. /*  stack problem handlers  (these calls do not return)  */
  1053.  
  1054. over:    call    _sr_stk_overflow
  1055. under:    call    _sr_stk_underflow
  1056. bad:    call    _sr_stk_corrupted
  1057.  
  1058.