in reply to Thread::Queue and Memory

Fisrt, take a look at POD for thread on Perl:

Perl threads tutorial (threads)
Old Perl threads tutorial (Thread)

Note that Perl 5.7+ has a new thread implementation, called ithreads, in the module "threads", and you still can access the old implementation, in the module Thread.

I don't know if the module Thread::Queue will work with ithreads (threads), since this module was inside the old way (Thread)!

You can see in the end of Thread POD, this comments on "See Also":

threads::shared (not available with 5005threads)

attributes, Thread::Queue, Thread::Semaphore, Thread::Specific (not available with ithreads)

Take a look at threads::share and the lock() function for a safe way to work with a shared list (since Thread::Queue is for a shared data structure, like a list).

Graciliano M. P.
"The creativity is the expression of the liberty".

Replies are listed 'Best First'.
Re: Re: Thread::Queue and Memory
by petesmiley (Friar) on Feb 21, 2003 at 02:49 UTC
    Doh! Slaps head. Of course.

    My confusion was somewhat caused by the examples listed in the tutorials. Not only that, but the Thread::Queue POD aludes to using "threads" not "Threads".

    Thanx Chief

    Update: Now that I've had time to think about it, it's not just locking I need, its cond_wait() and cond_signal(). Which is why I resorted to Thread::Queue fo simplification in the first place.

    If you look at the POD for Thread::Queue it refers to the ithreads implimentation. Not the old perl threads implimentation.

    • So, I either don't understand Thread::Queue properly and it is supposed to work with ithreads, and the docs on the old Threads POD needs to be updated.
    • Or, Thread::Queue is not supposed to work with ithreads and there is something fuzzy with the docs and there needs to be a clarification.
    • Or, there is something actually wrong with Thread::Queue, it is supposed to work with ithreads, and the docs for the old Threads implimentation needs to be fixed.
    Somehow, I think that last little line in the old Threads POD is not up to date according to the current documentation for perl 5.8.