On Wed, Apr 27, 2005 at 08:09:48AM +0200, Leopold Toetsch wrote:
> Robin Redeker <[EMAIL PROTECTED]> wrote:
[...]
> > 1. i wonder how to load bytecode from the memory to parrot when
> > embedding it. i've read embed.pod and couldn't find a function that let me
> > create a packfile or something i can run, from a memory buffer that holds 
> > the
> > bytecode.
> 
> from src/embed.c:Parrot_readbc()
> 
>   pf = PackFile_new(interpreter, is_mapped);
>   PackFile_unpack(interpreter, pf, (opcode_t *)program_code, program_size);
> 
> albeit it isn't part of the official embedding API (yet).

Ok, thanks, i'll have a look at that.
Any idea when there will be a more complete official embedding API?
Any hints when looking for functions that 'maybe' go into the API?

> > I've read that parrot wants to do a gc run over special marked objects, that
> > 'need' timely destruction. (correct me there..)
> 
> You can flag a PMC for timely destruction:
> 
>   needs_destroy $P0
> 
> On subroutine return (or scope exit) you can trigger a lazy DOD run,
> which does nothing if there aren't any objects that need timely
> destruction:
> 
>   sweep 1    # lazy DOD
> 
> This will eventually be replaced by:
> 
>   enter_scope 0 | 1  # NEEDS_TIMELY_DESTRUCTION
>   exit_scope

Does this mean, i have to know whether this subroutine handles objects
that need timely destruction?

> 
> or some such. (Currently the register frame, where the "sweep 1" is in,
> keeps these objects alive, so the lazy DOD run can only be run after the
> register frame is discarded)
> 
> > So, what would happen if i have many marked objects and call subroutines
> > often?
> 
> We'll try to make the lazy DOD run as fast as possible. Objects that
> need timely destruction are counted. If all such objects have been seen
> during DOD, the DOD run is aborted.

Well, what happens if some objects are not seen at the beginning, but
very late in the run? Does that mean, i maybe have to wait 100ms (or
longer, don't have any idea how long it may take) or such if i have around 
1*10^3 - 1*10^5 objects that need timely destruction?

And does that mean, the time spend in GC is very indeterministic?

> 
> > Or are there any other plans? What do other languages do, which
> > have refcounting and want to port to parrot?
> 
> You might have a look at ponie (perl5 on parrot). And, while Python
> doesn't guarantee timely destruction, people nethertheless rely on it,
> because CPython provides timely destruction due to refcounting.

Thanks, i'll have a look.

> 
> That means: most of our major target HLLs need timely destruction and
> we'll provide it.

cu,
robin

-- 
[EMAIL PROTECTED] / [EMAIL PROTECTED]
Robin Redeker

Reply via email to