in reply to Re: possibility to overcome perl threads
in thread possibility to overcome perl threads

I mean some mechanism not using perl "ithread", because I hate the weird sharing mechanism. It seems that it's very hard to share objects between threads.
  • Comment on Re^2: possibility to overcome perl threads

Replies are listed 'Best First'.
Re^3: possibility to overcome perl threads
by ikegami (Patriarch) on Oct 29, 2009 at 03:43 UTC

    If you want to use threads in Perl, you have to use Perl's threads. Threads need support at every level of the language in order to work.

    But that doesn't mean you can't build upon what's provided. Despite saying you mean something else, what you want is support in sharing objects. Sorry, I can't help you with that (not having done any threaded programming in Perl), but at least you know what you want now.

Re^3: possibility to overcome perl threads
by BrowserUk (Patriarch) on Oct 29, 2009 at 04:44 UTC
    it's very hard to share objects between threads.

    Could you describe the object(s) that you wish to share across threads? And why you feel the need to share them?

    Please note: I'm not implying that there is never a need to do this; just asking for a description of a situation when it is necessary advantagous to do so?


    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.
      Actually, Tk objects. I want to change the appearance of UI while executing something on a worker thread...

        Then you asked the wrong question.

        Even if there were an alternative implemetation of threading to threads, it wouldn't help because Tk objects are not thread-safe.

        Indeed. most guis use a queuing mechanism to allow background threads to interact with the gui thread (singular), and that is an efficient and relatively easy thing to do using threads and Thread::Queue.


        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.
Re^3: possibility to overcome perl threads
by desemondo (Hermit) on Oct 29, 2009 at 03:55 UTC