Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Some thoughts WRT exceptions, events, and threads
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Leopold Toetsch  
View profile  
 More options Jun 28 2003, 5:49 am
Newsgroups: perl.perl6.internals
From: l.toet...@nextra.at (Leopold Toetsch)
Date: Sat, 28 Jun 2003 11:39:08 +0200
Local: Sat, Jun 28 2003 5:39 am
Subject: Some thoughts WRT exceptions, events, and threads
I'd like to layout some thougts, which get quite dim, when it comes to
threads. So there are a lot of questions.

1) Exceptions
There are 3 kinds of exception sources:
- hard: e.g. SIGFPE, SIGHUP. They get catched by signal handlers[1]
- soft: internal_exception()
- user: a C<raise> opcode signals a warning or die ...

Parrot does a longjmp(3), constructs an exception object[2], searches
the control stack for a matching exception handler and reenters the run
loop at the exception subroutine if a matching handler was found. If
not, a default catch all handler takes the appropriate action.

pdd06 states:
        Exception handlers are dynamically scoped, and any
        exception handler set in a scope will be removed when that
        scope is exited.
Q: How do we automatically remove exception handlers at scope exit?

2) Events
They are generated by e.g. Timer objects or asynchronous IO. They are
kept in prioritized event queues per thread.

Q: When and how do we check the event queue, iff there is something?

3) Threads
The underlaying model are posix threads if available. This implies
that all interpreter data are shared by default. So we'll need per
thread data: interpreter, prederef & JIT code ...

Q: How do we separate shared and per thread variables?
    On thread creation do we copy all shared PMCs?
    Where are these PMCs living, i.e. do we have one common memory
    arena_base or per thread?
    What about DOD/GC?

Q: Can we use the thread system to run event code (suspend the main
code, run the event handler, resume main code - pthread doesn't seem
to have suspend, while pth(3) has it)

Implementation

Are there any bits already done?

[1] sigaction or signal based. On Win32 the main message loop may also
be a source of such events e.g. WM_CLOSE.
[2] for now, this might be a PerlHash

leo


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.