Next 4.1 Thread::Queue Prev

Thread::Queue

A thread-safe data structure much like a list. Threads may add elements to the end of the list and remove elements from the head of the list.

use Thread::Queue; my $queue = new Thread::Queue; # in one thread $queue->enqueue("foo", "bar"); # in the same or another thread my $foo = $queue->dequeue; my $bar = $queue->dequeue_nb; my $left = $queue->pending;

Thread::Queue::Any

Like Thread::Queue, but elements of any type and any number of them may be enqueued and dequeued at once.

Next Perl Threads Prev