--- Dave Whipp <[EMAIL PROTECTED]> wrote:
> Dulcimer wrote:
> >>sub slow_fn {
> >> my $tick = Timer.new(60, { print "..." });
> >> return slow_fn_imp @_;
> >>}
> >>
> >>Now if I could just get the compiler to not complain about that
> >>unused variable...
> >
> >
> > Maybe I'm being dense...
Dave Whipp said:
> I've just realised, however, that I'm relying on it being destroyed on
> leaving the scope. I'm not sure that the GC guarentees that.
GC doesn't, but I would be surprised if Perl 6 doesn't and in that case
Parrot will be accommodating.
Take a look at the recent p6i archives f
Dulcimer wrote:
sub slow_fn {
my $tick = Timer.new(60, { print "..." });
return slow_fn_imp @_;
}
Now if I could just get the compiler to not complain about that
unused variable...
Maybe I'm being dense
Why not just
sub slow_fn {
Timer.new(1, { print "." });
return slow_fn_imp @_;
> sub slow_fn {
>my $tick = Timer.new(60, { print "..." });
>return slow_fn_imp @_;
> }
>
> Now if I could just get the compiler to not complain about that
> unused variable...
Maybe I'm being dense
Why not just
sub slow_fn {
Timer.new(1, { print "." });
return slow_fn_imp @_;
"Luke Palmer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> my $result is lazy::threaded := { slow_fn_imp @_ };
> loop {
> timeout(60);
> return $result;
> CATCH {
> when Timeout { print "...$(time)\n"
> }
> }
>
> Now write the
On Thursday, May 29, 2003, at 04:48 PM, Luke Palmer wrote:
To nitpick:
my $result is lazy::threaded := { slow_fn_imp @_ };
Pursuing this lazy-threaded variables notion, a question. Given:
sub slow_func is threaded {# me likey this
auto-parallelizing syntax!
...
}
On Thursday, May 29, 2003, at 12:45 PM, Dave Whipp wrote:
"Michael Lazzaro" <[EMAIL PROTECTED]> wrote in> # But if
you want
to get the thread object, so you can monitor it's
{
...
my $tid = thread &slow_func_impl(...);
while $tid.active {
status_monitor(
Dave wrote:
> Still a bit too complex for my taste: perhaps we can use C to
> generate exceptions:
>
> my lazy::threaded $result := { slow_fn_imp @_ };
> loop {
> timeout(60);
> return $result;
> CATCH Timeout { print "...$(time)\n" }
> }
>
> At last, no C! (Reminder: the suggest
"John Macdonald" <[EMAIL PROTECTED]> wrote > At first glance, this
doesn't need a thread - a
> Instead of
> sleep, though, I'd use a pipeline and read it with
> a non-blocking read until there is no data. ...
++ For the lateral thinking. Definitely a valid solution to the problem, as
given. So I
On Thu, May 29, 2003 at 10:47:35AM -0700, Dave Whipp wrote:
> OK, we've beaten the producer/consumer thread/coro model to death. Here's a
> different use of threads: how simple can we make this in P6:
>
> sub slow_func
> {
> my $percent_done = 0;
> my $tid = thread { slow_f
"Michael Lazzaro" <[EMAIL PROTECTED]> wrote in> # But if you want
to get the thread object, so you can monitor it's
> {
> ...
> my $tid = thread &slow_func_impl(...);
> while $tid.active {
> status_monitor($tid.progress);
> sleep 60;
>
On Thursday, May 29, 2003, at 10:47 AM, Dave Whipp wrote:
OK, we've beaten the producer/consumer thread/coro model to death.
Here's a
different use of threads: how simple can we make this in P6:
Hey, good example. Hmm...
Well, for starters I think it wouldn't be a big deal to associate a
"prog
--- Dave Whipp <[EMAIL PROTECTED]> wrote:
> OK, we've beaten the producer/consumer thread/coro model to death.
> Here's a
> different use of threads: how simple can we make this in P6:
>
> sub slow_func
> {
> my $percent_done = 0;
> my $tid = thread { slow_func_imp( \$perc
13 matches
Mail list logo