Joshua Gatcomb <[EMAIL PROTECTED]> wrote:

[ Cygwin thread tests don't print all ]

Does this patch help? It creates shared IO resources. But its of course
not final: there are no precautions against one thread changing the PIO
of another thread or such, no locks yet, nothing.

leo

--- parrot/src/inter_create.c   Fri Oct  1 15:26:26 2004
+++ parrot-leo/src/inter_create.c       Sat Oct  2 12:06:10 2004
@@ -31,6 +31,12 @@
 #define ATEXIT_DESTROY

 /*
+ * experimental: use shared IO resources for threads
+ */
+
+#define PARROT_SHARED_IO 1
+
+/*

 =item C<static int is_env_var_set(const char* var)>

@@ -125,7 +131,15 @@

     /* PANIC will fail until this is done */
     SET_NULL(interpreter->piodata);
+#if PARROT_SHARED_IO
+    if (parent) {
+        interpreter->piodata = parent->piodata;
+    }
+    else
+        PIO_init(interpreter);
+#else
     PIO_init(interpreter);
+#endif

     if (is_env_var_set("PARROT_GC_DEBUG")) {
 #if ! DISABLE_GC_DEBUG
@@ -225,6 +239,9 @@
     setup_default_compreg(interpreter);

     /* setup stdio PMCs */
+#if PARROT_SHARED_IO
+    if (!parent)
+#endif
     PIO_init(interpreter);

     /* Done. Return and be done with it */
@@ -330,6 +347,9 @@
      */

     /* Now the PIOData gets also cleared */
+#if PARROT_SHARED_IO
+    if (!interpreter->parent_interpreter)
+#endif
     PIO_finish(interpreter);

     /*

Reply via email to