in reply to Re^11: Slow evolution of Perl = Perl is a closed Word (thread decade)
in thread Slow evolution of Perl = Perl is a closed Word

I was a bit terse. The "cache" was the application part. Given hard to construct objects (say, involving multiple database queries, or even user input), saving them to be reused rather than discarding and rebuilding as needed, in a situation where separate caches for each thread/process would either not be worthwhile or would be too memory consumptive.
  • Comment on Re^12: Slow evolution of Perl = Perl is a closed Word (thread decade)

Replies are listed 'Best First'.
Re^13: Slow evolution of Perl = Perl is a closed Word (thread decade)
by BrowserUk (Patriarch) on Sep 04, 2007 at 16:18 UTC
    I was a bit terse. The "cache" was the application part.

    Okay. I didn't see that interpretation.

    My first reaction is: whatever thread is responsible for the construction/generation of the objects that you want to cache, caches them.

    Ie. If you have a DB thread that is issuing queryies and retrieving results on behalf of all the other threads in the application, then it does the caching. If any thread asks for the same data, (presumably via a queue), then it replies with the results from its local cache.

    Ditto for user input. You have a single thread dealing with user input and when another thread requests input it is supplied from the input thread local cache if available.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      That still involves passing objects from thread to thread, which means marshalling/unmarshalling.
        That still involves passing objects from thread to thread

        No. Objects do not spring into existance, they are initialised from some source. In the examples above, that source is a byte stream from a keyboard or a simple data structure created from a DB-sourced datastream.

        Strings, and hashes or arrays. These can be cached in the originating thread and shared for passing between threads. They only get constituted into objects within the thread that is going to use them. The initialisation data just stays in the form in which it originates until it is passed to the therad that needs the object.

        So there is no marshalling/unmarshalling involved, just delayed object creation/initialisation.


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.