Path: news.daimi.aau.dk!news.uni-c.dk!nntp-oslo.UNINETT.no!nntp-trd.UNINETT.no!online.no!oslonett.no!sn.no!Norway.EU.net!EU.net!newsfeed.internetmci.com!in3.uu.net!manawatu.planet.co.nz!manawatu.gen.nz!news.express.co.nz!waikato!canterbury.ac.nz!usenet From: kasper@pukeko.cosc.canterbury.ac.nz (Kasper Osterbye) Newsgroups: comp.lang.beta Subject: Re: THIS and COMPONENTs Date: 08 Aug 1996 20:43:46 GMT Organization: University of Canterbury Lines: 51 Distribution: world Message-ID: References: <4tq4s1$muk@gjallar.daimi.aau.dk> NNTP-Posting-Host: 132.181.12.13 In-reply-to: "S\xren Brandt"'s message of 1 Aug 1996 11:36:33 GMT Hi again, I guess it was I who started this, and I can see that the discussion went on, but I have not followed it on a day by day basis, and now some parts are missing. The low-level gismo that Soeren gave me/us is not the way it SHOULD be done, but a way it CAN be done until we find out what can be done about it, and until the compiler can handle it (those two things were never the same with BETA - does :: work btw?). My problem was that I wanted to do simulation, and needed to implement processes that are scheduled according to simulation time. But it should also be possible to put such an entity to sleep in a queue, and I found it would be natural for the process to be able to say "myQueue.wait", and I wanted to implement "wait" like wait : (# do "the presently executing coroutine"[] -> theQueue.insert; SUSPEND #) Also I wanted to be able to start new processes like "myProcess.start", and wanted to implement start like: start : (# do this(Process)[] -> scheduler.insert #) Soerens gizmo helped me do the last one, and I do not find it very problematic to do start: (# do this(Process)[] -> objectToComponent -> scheduler.insert #) However, the "wait" I could not do without introducing an explicit "presently executing process" variable in the scheduler. This is also done in the system libraries, so I assume that the problem is well known, and that a "presently executing process" is part of the standard workaround in building schedulers. Indeed, Soeren thought that this was my original problem, and suggested that I used the that idea. Notice that in the low-level library, there is a pattern that will test if an object-reference does indeed refer to a component, that will allow us to use objectToComponent in a safe manner. I assume that Soerens gizmo will be part of the lowlevel libraries sometime in the future. -- Kasper