RE: New 'threads' methods

[email protected] ("Jerry D. Hedden")
Newsgroups perl.perl5.porters,perl.ithreads
Message-ID <20060705105803.fb30e530d17747c2b054d625b8945d88.41d0e2e9a7.wbe@email.secureserver.net>
Mike Pomraning wrote:
> Thread::Running's threads->tojoin suggests that a class method to return all
> nondetached, nonrunning and nonjoined threads is useful.

This would be syntactical sugar for:

    my @joinable = grep { $_->is_joinable() } threads->list();

However, I would rather 'enhance' the syntax for threads->list() to take
a parameter to return that kind of information:

    my @joinable = threads->list(threads::joinable);

where the parameter would be defined as a 'constant' in threads.pm:

    sub threads::joinable { 0 };

Similarly, we would have:

    sub threads::running { 1 };

    my @running = threads->list(threads::running);

Or am I making things too hard?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.