(forwarded in case anyone else is following this)
Begin forwarded message:
myCroquet.st (13K) Download Attachment |
On Nov 28, 2006, at 20:41 , Rob Van Pamel wrote:
> I now have added the folowing lines to my NavigatorMaster. > > spaceRef := island future at:#mainEntry. > islandRef := spaceRef island. > (This is creating a TFarRef for my island Right?) > > What i don't understand is how you connect to this space. I have a > Class NavigatorWorld and a Class NavigatorMaster. In > NavigatorMaster i've created the Reference for the island. Now i > want to access that Reference to add objects(cubes). But how does > NavigatorWorld knows that SpaceRef is a Reference to the island > from the other Class? I think i am missing something. Or do i have > to add my objects in the NavigatorMaster? I'm getting very confused > for the moment. Can you maybe explain a little bit how that future > sending works? Did you read the Croquet Programming Guide? - Bert - |
In reply to this post by Joshua Gargus-2
I haven't been following this thread very closely, but it *feels*
like the kind of conversation where there's a lot of detail but less understanding of the big picture. What are you really trying to do again? I mean this in the sense of what result you want, not how you're thinking that you want to go about it. See http://catb.org/esr/faqs/ smart-questions.html Most programming should just be "normal", done completely within the island, with no future sends, no TFarRefs, and no references to the island or any globals. Occassionaly, when creating a NON-replicated user interface, you will want that UI to send a SMALL number of future messages to the island. E.g., from the harness: newObject := self activeIsland future new: MyClass. self activeSpace future addChild: newObject. But this is pretty rare. And for the most part, you don't even really have to know how the future send works. You can think of it as just, "This is the way you have non-replicated code create something 'as soon as convenient at some future time' in a replicated island." [ If you insist on getting into the detail it's not very hard: 1. You never (should) see a naked pointer for an object from outside the island it lives on. You only see a proxy for it. 2. These proxies (TFarRefs) are pretty dumb. They only understand a few messages, including, particularly, #future. As described in the programming guide, #future is handled by replicating the next message (#new: and #addChild: in my example above) among all the replicants of the objects that the proxy is for. It may or may not also help you to think of each island running in it's own thread. (There are actually many processes running.) The #future mechanism is designed to let you not have to worry about that -- to make it easier -- but knowing this should help set of warning bells in your head if you should find yourself wondering why you don't see stuff from other islands in your debugger stack. ] On Nov 28, 2006, at 1:41 PM, Rob Van Pamel wrote: > I now have added the folowing lines to my NavigatorMaster. > > spaceRef := island future at:#mainEntry. > islandRef := spaceRef island. > (This is creating a TFarRef for my island Right?) > > What i don't understand is how you connect to this space. I have a > Class NavigatorWorld and a Class NavigatorMaster. In > NavigatorMaster i've created the Reference for the island. Now i > want to access that Reference to add objects(cubes). But how does > NavigatorWorld knows that SpaceRef is a Reference to the island > from the other Class? I think i am missing something. Or do i have > to add my objects in the NavigatorMaster? I'm getting very confused > for the moment. Can you maybe explain a little bit how that future > sending works? |
In reply to this post by Joshua Gargus-2
I'm sorry, I'm still not understanding what you're really trying to do.
The description below is still very prescriptive. I can't imagine anyone (e.g., my neighbor, or my son's friend) waking up one morning and saying, "Man, if only I had a program that added an object to an island from another process! That would be cool! Oh, and it should check a database at a given interval, too." In my opinion (just me), I think you might try taking a step back and try to describe the end-user problem you're trying to solve, as simply and jargon-free as possible. Rob Van Pamel wrote: > What i want to do is add object to my island from another process. > The big picture is that i have to check a database at a given interval (eg 10sec). I have implemented it with a delay like this > > [ running ] whileTrue: [ > self step. > (Delay forMilliseconds: 5000) wait. > ]. > > If i don't put this in a new procees (with fork) the whole system comes very slow. But in step I update my island. which means adding object to my island. And this give's me the problem. > And i really have ridden the Croquet Programming Guide. > You must know that i'm quiet new to Croquet - Squeak. > I hope you understand now what the problem is. > > Thanks -- Howard Stearns University of Wisconsin - Madison Division of Information Technology mailto:[hidden email] jabber:[hidden email] voice:+1-608-262-3724 |
In reply to this post by Joshua Gargus-2
Yes, we need more input. From your description you could just run
that process in your island, but for some reason you seem to not want to do that. - Bert - On Nov 30, 2006, at 16:27 , Howard Stearns wrote: > I'm sorry, I'm still not understanding what you're really trying to > do. The description below is still very prescriptive. I can't > imagine anyone (e.g., my neighbor, or my son's friend) waking up > one morning and saying, "Man, if only I had a program that added an > object to an island from another process! That would be cool! Oh, > and it should check a database at a given interval, too." > > In my opinion (just me), I think you might try taking a step back > and try to describe the end-user problem you're trying to solve, as > simply and jargon-free as possible. > > Rob Van Pamel wrote: >> What i want to do is add object to my island from another process. >> The big picture is that i have to check a database at a given >> interval (eg 10sec). I have implemented it with a delay like this >> [ running ] whileTrue: [ >> self step. >> (Delay forMilliseconds: 5000) wait. >> ]. >> If i don't put this in a new procees (with fork) the whole system >> comes very slow. But in step I update my island. which means >> adding object to my island. And this give's me the problem. And i >> really have ridden the Croquet Programming Guide. You must know >> that i'm quiet new to Croquet - Squeak. I hope you understand now >> what the problem is. >> Thanks |
Free forum by Nabble | Edit this page |