From aff36865d5e738babdbf36f34fd0693b67bb3d90 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 29 Apr 2011 05:45:44 +0000 Subject: xepoll_thread_spawn: initial implementation Whee! This is going to be awesome. --- t/GNUmakefile | 1 + t/simple-http_XEpollThreadSpawn.ru | 10 ++++++++++ t/t0022-copy_stream-byte-range.sh | 1 + t/t9100-thread-timeout.sh | 1 + t/t9101-thread-timeout-threshold.sh | 1 + 5 files changed, 14 insertions(+) create mode 100644 t/simple-http_XEpollThreadSpawn.ru (limited to 't') diff --git a/t/GNUmakefile b/t/GNUmakefile index 7cb7db4..408eabf 100644 --- a/t/GNUmakefile +++ b/t/GNUmakefile @@ -21,6 +21,7 @@ export RUBY_VERSION RUBY_ENGINE ifeq (Linux,$(shell uname -s)) models += XEpoll + models += XEpollThreadSpawn models += Epoll endif models += WriterThreadPool diff --git a/t/simple-http_XEpollThreadSpawn.ru b/t/simple-http_XEpollThreadSpawn.ru new file mode 100644 index 0000000..e89fccc --- /dev/null +++ b/t/simple-http_XEpollThreadSpawn.ru @@ -0,0 +1,10 @@ +use Rack::ContentLength +use Rack::ContentType +run lambda { |env| + if env['rack.multithread'] == true && + env['rainbows.model'] == :XEpollThreadSpawn + [ 200, {}, [ Thread.current.inspect << "\n" ] ] + else + raise env.inspect + end +} diff --git a/t/t0022-copy_stream-byte-range.sh b/t/t0022-copy_stream-byte-range.sh index 7539c02..3e0a66b 100755 --- a/t/t0022-copy_stream-byte-range.sh +++ b/t/t0022-copy_stream-byte-range.sh @@ -11,6 +11,7 @@ esac case $model in ThreadSpawn|WriterThreadSpawn|ThreadPool|WriterThreadPool|Base) ;; +XEpollThreadSpawn) ;; *) t_info "skipping $T since it doesn't use IO.copy_stream" exit 0 diff --git a/t/t9100-thread-timeout.sh b/t/t9100-thread-timeout.sh index 422052e..8d61cc5 100755 --- a/t/t9100-thread-timeout.sh +++ b/t/t9100-thread-timeout.sh @@ -4,6 +4,7 @@ case $model in ThreadSpawn|ThreadPool) ;; RevThreadSpawn|RevThreadPool) ;; CoolioThreadSpawn|CoolioThreadPool) ;; +XEpollThreadSpawn) ;; *) t_info "$0 is only compatible with Thread*"; exit 0 ;; esac diff --git a/t/t9101-thread-timeout-threshold.sh b/t/t9101-thread-timeout-threshold.sh index 7309475..67e65f6 100755 --- a/t/t9101-thread-timeout-threshold.sh +++ b/t/t9101-thread-timeout-threshold.sh @@ -4,6 +4,7 @@ case $model in ThreadSpawn|ThreadPool) ;; RevThreadSpawn|RevThreadPool) ;; CoolioThreadSpawn|CoolioThreadPool) ;; +XEpollThreadSpawn) ;; *) t_info "$0 is only compatible with Thread*"; exit 0 ;; esac -- cgit v1.2.3-24-ge0c7