Re: Add #22337

2003-05-30 Thread Leopold Toetsch
Dan Sugalski wrote: [ zerofilled aligned memory ] That, as much as anything, argues for an entry in platform.c to get and return large sections of memory. I know it's reasonably doable on a lot of platforms, just potentially differently everywhere. BTW the zero filled memory is not that impor

Threads and Progress Monitors

2003-05-30 Thread Dave Whipp
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( \$percent_done ) }; thread { status_monitor($percent_do

Re: Threads and Progress Monitors

2003-05-30 Thread Austin Hastings
--- 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

Re: Threads and Progress Monitors

2003-05-30 Thread Michael Lazzaro
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

Re: Threads and Progress Monitors

2003-05-30 Thread Dave Whipp
"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; >

Re: Threads and Progress Monitors

2003-05-30 Thread John Macdonald
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

Re: Compile-time binding

2003-05-30 Thread Damian Conway
Luke Palmer asked: what's compile-time binding? A normal binding: $name := expr; is a run-time operation that installs its RHS operand as a new implementation for the LHS symbol. That is, it means: $CurrentPackage::{'$name'} = \(expr) (with some special magic that only enreferences C if it'

Re: Threads and Progress Monitors

2003-05-30 Thread Dave Whipp
"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

Re: Threads and Progress Monitors

2003-05-30 Thread Luke Palmer
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

Re: Threads and Progress Monitors

2003-05-30 Thread Michael Lazzaro
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(

Re: Threads and Progress Monitors

2003-05-30 Thread Michael Lazzaro
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! ... }

Re: Threads and Progress Monitors

2003-05-30 Thread Dave Whipp
"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

Re: Threads and Progress Monitors

2003-05-30 Thread Dulcimer
> 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 @_;

Re: Threads and Progress Monitors

2003-05-30 Thread Dave Whipp
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 @_;

Re: Threads and Progress Monitors

2003-05-30 Thread Paul Johnson
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

Re: [perl #22353] JIT!

2003-05-30 Thread Luke Palmer
> Luke Palmer <[EMAIL PROTECTED]> wrote: > > > It appears JIT is entirely broken. It broke recently, as it was > > working well for me just a couple days ago. > > > I'm running i686 (P3) Linux, gcc-3.2.2 > > > I get segfaults with both imcc -Oj and parrot -j (with assemble.pl) on > > mandel.pas

save[insp]/restore[insp]

2003-05-30 Thread Benjamin Goldberg
Looking over the code for these ops, ISTM that the stack_push and stack_pop functions which implements them is too bloated. How often, in practice, is the Stack_cleanup_method cleanup thing needed? On those occasions when it is needed, is it ever with a Num, Int, or Str? Or is it only with PMCs

Re: Add #22337

2003-05-30 Thread Steve Fink
[EMAIL PROTECTED]:~/parrot/languages/perl6% man memalign POSIX_MEMALIGN(3) Linux Programmer's ManualPOSIX_MEMALIGN(3) NAME posix_memalign, memalign, valloc - Allocate aligned memory SYNOPSIS #include int posix_memalign(void **memptr, size_t alignment, size_t size);

Method calling

2003-05-30 Thread Dan Sugalski
Nope, not objects, but at least it's partway there. This bit is about making method calls. We've two issues on the front end. First, we need to be able to get a method PMC from an object, in those cases where we want to save that for later, and second we need to call methods. So, here's how we'