You need to use AttachThread() to request a RexxThreadContext object that is valid on the other threads. Then any of the APIs defined on RexxThreadContext will be available to you.
Rick On Fri, May 22, 2009 at 8:49 PM, James Johnson <[email protected]> wrote: > I tried your suggestion of using the GetAllContextVariables() method. It > fails when I try to read > the directory from another thread. I used the context method > DirectoryAt() to read the directory. > In looking at the interpreter code, it appears to me that using any of > the context methods from a > different thread will fail. > > James Johnson > > > Rick McGuire wrote: >> Sorry, but no. If we add this, then this is something that will need >> to be supported forever, and I'm just not going to deal with it. This >> is not something we can support, particularly when the request comes >> right before the release. At this point, we're only fixing bugs, not >> adding new features. >> >> I suspect there may be other alternatives that might give you what you >> need without requiring violations of the core programming model. For >> example, you can read or write to stem variables from another thread >> if you first request the backing stem objects on the main thread and >> pass the references along to the other threads. The secondary threads >> can access the elements of those stem objects using just the APIs >> available to a thread context. If you don't need write access to any >> variables other than stems, you can use GetAllContextVariables() to >> get a variable snapshot and use that directory to access the >> information....and again, the stem objects obtained from that >> directory will be readable and writeable from the other threads. >> >> Rick >> >> On Thu, May 21, 2009 at 4:17 PM, James Johnson <[email protected]> wrote: >> >>> Ok, you wont allow multiple threads access to a call context, but would >>> you allow an >>> application developer to shot him self in the foot if he has a mind to. >>> >>> Would you consider adding a new interpreter option, THREAD_ISOLATION. >>> If set or allowed to default, to TRUE the current behavior is in effect >>> When set to FALSE the thread is not validated. >>> >>> It would then be the application developers responsibility for any >>> conflicts that would arise >>> when running with this option set to FALSE. >>> >>> James Johnson >>> >>> Rick McGuire wrote: >>> >>>> On Thu, May 21, 2009 at 11:11 AM, Mark Miesfeld <[email protected]> wrote: >>>> >>>> >>>>> On Thu, May 21, 2009 at 7:36 AM, Rick McGuire <[email protected]> >>>>> wrote: >>>>> >>>>> >>>>>> He wants to use the RexxCallContext pointer to modify the caller's >>>>>> variables from another thread. This is something that is not >>>>>> available on an attached thread since you only obtain a thread >>>>>> context, not a call context. >>>>>> >>>>>> >>>>> Thanks Rick. I wasn't of course suggesting that you make any changes >>>>> to what we have right now. <grin> Just trying to understand things >>>>> better. >>>>> >>>>> So, from a method context or a call context you can get a thread >>>>> context. Which is the thread the invoked method or call is executing >>>>> on. >>>>> >>>>> >From an interpreter instance you can use AttachThread() to gain a >>>>> thread context. Now, with that thread context you can use one of the >>>>> SendMessage() variants to send messages to objects you know about, >>>>> even if the objects are executing on another interpreter thread. Is >>>>> that correct? >>>>> >>>>> Mostly looking at this from an ooDialog point of view, where I want to >>>>> send messages from the Windows message loop thread, for a Windows >>>>> dialog, back to the ooRexx dialog object. The ooRexx dialog is course >>>>> executing on a different thread than the Windows message loop. As >>>>> long as I have a good pointer to the ooRexx object, this will work, >>>>> correct? >>>>> >>>>> >>>> Yes, because this operation only requires the services provided by a >>>> RexxThreadContext object. The additional methods provided by a >>>> RexxCallContext allow you to "reach back" into the thing that called >>>> you and perform operations. For example, SetContextVariable(). This >>>> only has meaning when called when you have something preceding you in >>>> the call stack. >>>> >>>> Note that if the main thread retrieves the value of a stem variable >>>> (which will be a Stem object), then the other threads can us the >>>> RexxThreadContext obtained from an AttachThread() call to set values >>>> in the Stem object. This is a well defined usage because once the >>>> object reference is obtained, you're no longer dependent upon the >>>> calling context. >>>> >>>> Rick >>>> >>>> >>>> >>>>> -- >>>>> Mark Miesfeld >>>>> >>>>> ------------------------------------------------------------------------------ >>>>> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT >>>>> is a gathering of tech-side developers & brand creativity professionals. >>>>> Meet >>>>> the minds behind Google Creative Lab, Visual Complexity, Processing, & >>>>> iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian >>>>> Group, R/GA, & Big Spaceship. http://www.creativitycat.com >>>>> _______________________________________________ >>>>> Oorexx-devel mailing list >>>>> [email protected] >>>>> https://lists.sourceforge.net/lists/listinfo/oorexx-devel >>>>> >>>>> >>>>> >>>> ------------------------------------------------------------------------------ >>>> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT >>>> is a gathering of tech-side developers & brand creativity professionals. >>>> Meet >>>> the minds behind Google Creative Lab, Visual Complexity, Processing, & >>>> iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian >>>> Group, R/GA, & Big Spaceship. http://www.creativitycat.com >>>> _______________________________________________ >>>> Oorexx-devel mailing list >>>> [email protected] >>>> https://lists.sourceforge.net/lists/listinfo/oorexx-devel >>>> >>>> >>>> >>> ------------------------------------------------------------------------------ >>> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT >>> is a gathering of tech-side developers & brand creativity professionals. >>> Meet >>> the minds behind Google Creative Lab, Visual Complexity, Processing, & >>> iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian >>> Group, R/GA, & Big Spaceship. http://www.creativitycat.com >>> _______________________________________________ >>> Oorexx-devel mailing list >>> [email protected] >>> https://lists.sourceforge.net/lists/listinfo/oorexx-devel >>> >>> >> >> ------------------------------------------------------------------------------ >> Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT >> is a gathering of tech-side developers & brand creativity professionals. Meet >> the minds behind Google Creative Lab, Visual Complexity, Processing, & >> iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian >> Group, R/GA, & Big Spaceship. http://www.creativitycat.com >> _______________________________________________ >> Oorexx-devel mailing list >> [email protected] >> https://lists.sourceforge.net/lists/listinfo/oorexx-devel >> >> > > > ------------------------------------------------------------------------------ > Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT > is a gathering of tech-side developers & brand creativity professionals. Meet > the minds behind Google Creative Lab, Visual Complexity, Processing, & > iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian > Group, R/GA, & Big Spaceship. http://www.creativitycat.com > _______________________________________________ > Oorexx-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/oorexx-devel > ------------------------------------------------------------------------------ Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT is a gathering of tech-side developers & brand creativity professionals. Meet the minds behind Google Creative Lab, Visual Complexity, Processing, & iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian Group, R/GA, & Big Spaceship. http://www.creativitycat.com _______________________________________________ Oorexx-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/oorexx-devel
