threads branch status update
Andy Dougherty
doughera at lafayette.edu
Tue Apr 17 21:06:00 UTC 2012
On Mon, 16 Apr 2012, Stefan Seifert wrote:
> So I guess it's time to throw a couple of more eyeballs at this branch. It
> will also offer plenty of opportunity for further improvements. It's got
> everything from a beginner's exercise like making the number of threads
> configurable or even auto-tuned to the number of available CPU cores to
> challenges like getting rid of the locks in the GC.
Here's what I found on Solaris 11/x86 with Sun's compiler:
First, I needed to apply this patch (void functions can't return a
value):
diff --git a/src/gc/gc_gms.c b/src/gc/gc_gms.c
index a43293d..f528d67 100644
--- a/src/gc/gc_gms.c
+++ b/src/gc/gc_gms.c
@@ -2057,7 +2057,8 @@ gc_gms_write_barrier(PARROT_INTERP, ARGMOD(PMC *pmc))
ASSERT_ARGS(gc_gms_write_barrier)
if (PObj_is_shared_TEST(pmc) && Interp_flags_TEST(interp, PARROT_IS_THREAD)) {
- return gc_gms_write_barrier(interp->thread_data->main_interp, pmc);
+ gc_gms_write_barrier(interp->thread_data->main_interp, pmc);
+ return;
}
if (interp->thread_data)
Next, I needed to apply this patch to the generated file
src/pmc/proxy.c. I know it is generated, but I can't find where the
erroneous lines come from. These are all more instances of void
functions trying to return a value.
--- a/src/pmc/proxy.c 2012-04-17 15:55:14.736468142 -0400
+++ b/src/pmc/proxy.c.fixed 2012-04-17 15:55:03.350687985 -0400
@@ -775,7 +775,7 @@
static void
Parrot_Proxy_destroy(PARROT_INTERP, ARGMOD(PMC *_self))
{
- return VTABLE_destroy(interp, PARROT_PROXY(_self)->target);
+ VTABLE_destroy(interp, PARROT_PROXY(_self)->target);
}
static PMC *
Parrot_Proxy_divide(PARROT_INTERP, ARGMOD(PMC *_self), PMC *value, PMC *dest)
@@ -1011,7 +1011,7 @@
static void
Parrot_Proxy_freeze(PARROT_INTERP, ARGMOD(PMC *_self), PMC *info)
{
- return VTABLE_freeze(interp, PARROT_PROXY(_self)->target, info);
+ VTABLE_freeze(interp, PARROT_PROXY(_self)->target, info);
}
static PMC *
Parrot_Proxy_get_attr_keyed(PARROT_INTERP, ARGMOD(PMC *_self), PMC *key, STRING *idx)
@@ -2415,7 +2415,7 @@
static void
Parrot_Proxy_visit(PARROT_INTERP, ARGMOD(PMC *_self), PMC *info)
{
- return VTABLE_visit(interp, PARROT_PROXY(_self)->target, info);
+ VTABLE_visit(interp, PARROT_PROXY(_self)->target, info);
}
static void
Parrot_Proxy_add_attribute_orig(PARROT_INTERP, ARGMOD(PMC *_self), STRING *name, PMC *type)
Then, the tests hung on t/pmc/task.t. Here's the specific output:
./parrot t/pmc/task.t
1..6
ok 1 - initialized
ok 2 task1 ran
ok 3 task2 ran
ok 4 sub1 ran
[At this point it hangs].
I tried the examples, but I don't know what any of them are supposed
to do, so I don't know what's expected.
./parrot examples/threads/chameneos.pir
going to sleep
This is 0 and I'm Yellow
This is 1 and I'm Blue
This is 2 and I'm Red
This is 3 and I'm Blue
Then it hangs.
./winxed examples/threads/matrix_part.winxed
gobbles up all available memory, doesn't print anything, and
hangs.
./parrot examples/threads/moretasks.pir
prints out lots of oks, then lots of 0s, then runs out of memory
and panics.
./parrot examples/threads/tasks.pir
prints out long strings of a's and b's without stopping. After a
while, I killed it.
I hope this is of some help,
--
Andy Dougherty doughera at lafayette.edu
More information about the parrot-dev
mailing list