[#1884] multiple exceptions for assert_raises — nobu.nokada@...

Hi,

14 messages 2003/12/04

[#1932] --enable-pthread broken? — Nathaniel Talbott <nathaniel@...>

[ruby-talk: 87759] and the surrounding thread seem to indicate that

29 messages 2003/12/11
[#1933] Re: --enable-pthread broken? — matz@... (Yukihiro Matsumoto) 2003/12/11

Hi,

[#1934] Re: --enable-pthread broken? — Nathaniel Talbott <nathaniel@...> 2003/12/11

On Dec 11, 2003, at 11:49, Yukihiro Matsumoto wrote:

[#1935] Re: --enable-pthread broken? — ts <decoux@...> 2003/12/11

>>>>> "N" == Nathaniel Talbott <nathaniel@talbott.ws> writes:

[#1937] Re: --enable-pthread broken? — nobu.nokada@... 2003/12/11

Hi,

[#1938] Re: --enable-pthread broken? — Nathaniel Talbott <nathaniel@...> 2003/12/12

On Dec 11, 2003, at 16:10, nobu.nokada@softhome.net wrote:

[#1939] Re: --enable-pthread broken? — matz@... (Yukihiro Matsumoto) 2003/12/12

Hi,

[#1941] Re: --enable-pthread broken? — matz@... (Yukihiro Matsumoto) 2003/12/12

Hi,

[#1943] Re: --enable-pthread broken? — Nathaniel Talbott <nathaniel@...> 2003/12/12

On Dec 11, 2003, at 20:48, Yukihiro Matsumoto wrote:

[#1953] Re: --enable-pthread broken? — matz@... (Yukihiro Matsumoto) 2003/12/13

Hi,

[#1959] Re: --enable-pthread broken? — ts <decoux@...> 2003/12/14

>>>>> "Y" == Yukihiro Matsumoto <matz@ruby-lang.org> writes:

[#1961] Re: --enable-pthread broken? — matz@... (Yukihiro Matsumoto) 2003/12/15

Hi,

[#1962] Re: --enable-pthread broken? — ts <decoux@...> 2003/12/15

>>>>> "Y" == Yukihiro Matsumoto <matz@ruby-lang.org> writes:

[#1936] Can't define +@ for Symbol (plus ruby install problem) — "T. Onoma" <transami@...>

I wanted to see if the +@ problem was fixed in 1.8.1 preview 3 but when I do

11 messages 2003/12/11

[#1973] Where to install documentation — Dave Thomas <dave@...>

Folks:

48 messages 2003/12/15
[#1982] Re: Where to install documentation — Eric Hodel <drbrain@...7.net> 2003/12/15

Dave Thomas (dave@pragprog.com) wrote:

[#1984] Re: Where to install documentation — Dave Thomas <dave@...> 2003/12/15

[#1991] Re: Where to install documentation — "Gavin Sinclair" <gsinclair@...> 2003/12/16

>

[#1992] Re: Where to install documentation — Dave Thomas <dave@...> 2003/12/16

[#2000] Re: Where to install documentation — Minero Aoki <aamine@...> 2003/12/16

Hi,

[#2002] Re: Where to install documentation — Dave Thomas <dave@...> 2003/12/16

[#2037] --enable-pthread still segfaults... — Nathaniel Talbott <nathaniel@...>

I've finally been able to test my application under load using the

25 messages 2003/12/23
[#2038] Re: --enable-pthread still segfaults... — matz@... (Yukihiro Matsumoto) 2003/12/23

Hi,

[#2039] Re: --enable-pthread still segfaults... — Nathaniel Talbott <nathaniel@...> 2003/12/23

On Dec 23, 2003, at 14:17, Yukihiro Matsumoto wrote:

[#2040] Re: --enable-pthread still segfaults... — matz@... (Yukihiro Matsumoto) 2003/12/23

Hi,

[#2041] Re: --enable-pthread still segfaults... — Nathaniel Talbott <nathaniel@...> 2003/12/23

On Dec 23, 2003, at 14:34, Yukihiro Matsumoto wrote:

[#2042] Re: --enable-pthread still segfaults... — matz@... (Yukihiro Matsumoto) 2003/12/23

Hi,

[#2043] Re: --enable-pthread still segfaults... — Nathaniel Talbott <nathaniel@...> 2003/12/23

On Dec 23, 2003, at 14:44, Yukihiro Matsumoto wrote:

[#2045] Re: --enable-pthread still segfaults... — matz@... (Yukihiro Matsumoto) 2003/12/23

Hi,

[#2046] Re: --enable-pthread still segfaults... — Nathaniel Talbott <nathaniel@...> 2003/12/23

> I'm afraid you're using old configure file. Can you wipe off old

[#2049] Re: --enable-pthread still segfaults... — Nathaniel Talbott <nathaniel@...> 2003/12/23

On Dec 23, 2003, at 15:18, Nathaniel Talbott wrote:

[#2050] Re: --enable-pthread still segfaults... — matz@... (Yukihiro Matsumoto) 2003/12/23

In message "Re: --enable-pthread still segfaults..."

[#2122] Bad interaction between timeout.rb and --enable-pthread — Nathaniel Talbott <nathaniel@...>

Here's a testcase that shows the problem:

13 messages 2003/12/31
[#2123] sleep is broken with --enable-pthread [Was: Bad interaction between timeout.rb and --enable-pthread] — Nathaniel Talbott <nathaniel@...> 2003/12/31

I should have reduced it more before posting...

Re: --enable-pthread broken?

From: nobu.nokada@...
Date: 2003-12-15 14:18:50 UTC
List: ruby-core #1969
Hi,

At Mon, 15 Dec 2003 22:00:51 +0900,
Yukihiro Matsumoto wrote:
> |Y> I thought context switch would not happen during restore_context,
> |Y> because rb_trap_immediate is turned off.  Am I wrong?
> |
> | ruby has a new thread thread_timer() where it can call nanosleep() when
> | rb_thread_critical is set and it has catch_timer()
> 
> Sorry for being stupid, but rb_trap_immediate is turned off in the
> restore_context, so thread_timer only set rb_thread_pending to 1 at
> most during the function execution, thus context switch would not
> happen even when tb_thread_critical is not set, right?

Isn't there a possibility that main pthread enters a critical
section, while the timer thread is sending the signal and
before it arrives to the main?


Index: eval.c
===================================================================
RCS file: /cvs/ruby/src/ruby/eval.c,v
retrieving revision 1.605
diff -u -2 -p -d -w -r1.605 eval.c
--- eval.c	13 Dec 2003 09:13:39 -0000	1.605
+++ eval.c	15 Dec 2003 14:03:28 -0000
@@ -9499,7 +9499,5 @@ static int thread_init = 0;
 #endif
 
-#if defined(PTHREAD_TIMER)
-static pthread_t time_thread;
-
+#if defined(PTHREAD_TIMER) || defined(HAVE_SETITIMER)
 static void
 catch_timer(sig)
@@ -9509,6 +9507,14 @@ catch_timer(sig)
     signal(sig, catch_timer);
 #endif
+    if (!rb_thread_critical) {
+	if (rb_trap_immediate) {
     rb_thread_schedule();
+	}
+	else rb_thread_pending = 1;
+    }
 }
+
+#ifdef PTHREAD_TIMER
+static pthread_t time_thread;
 
 static void*
@@ -9519,15 +9525,8 @@ thread_timer(dummy)
 
     for (;;) {
-	if (!rb_thread_critical) {
-	    if (rb_trap_immediate) {
 		pthread_kill(ruby_thid, SIGVTALRM);
-	    }
-	    else {
-		rb_thread_pending = 1;
-	    }
 	    req.tv_sec = 0;
 	    req.tv_nsec = 10000000;
 	    nanosleep(&req, &rem);
-	}
     }
 }
@@ -9542,21 +9541,5 @@ rb_thread_stop_timer()
 {
 }
-#elif defined(HAVE_SETITIMER)
-
-static void
-catch_timer(sig)
-    int sig;
-{
-#if !defined(POSIX_SIGNAL) && !defined(BSD_SIGNAL)
-    signal(sig, catch_timer);
-#endif
-    if (!rb_thread_critical) {
-	if (rb_trap_immediate) {
-	    rb_thread_schedule();
-	}
-	else rb_thread_pending = 1;
-    }
-}
-
+#else  /* HAVE_SETITIMER */
 void
 rb_thread_start_timer()
@@ -9582,5 +9565,6 @@ rb_thread_stop_timer()
     setitimer(ITIMER_VIRTUAL, &tval, NULL);
 }
-#else
+#endif
+#else  /* !(PTHREAD_TIMER || HAVE_SETITIMER) */
 int rb_thread_tick = THREAD_TICK;
 #endif


-- 
Nobu Nakada

In This Thread