From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-3.1 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id 8A9842047F for ; Thu, 28 Sep 2017 01:07:12 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id AE514120A33; Thu, 28 Sep 2017 10:07:10 +0900 (JST) Received: from dcvr.yhbt.net (dcvr.yhbt.net [64.71.152.64]) by neon.ruby-lang.org (Postfix) with ESMTPS id BACED120A32 for ; Thu, 28 Sep 2017 10:06:57 +0900 (JST) Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 566FE2047F; Thu, 28 Sep 2017 01:06:50 +0000 (UTC) Date: Thu, 28 Sep 2017 01:06:50 +0000 From: Eric Wrong To: ruby-core@ruby-lang.org Message-ID: <20170928010649.GA21035@whir> References: <20170831055815.GA4537@starla> <20170912054027.GA13706@whir> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20170912054027.GA13706@whir> X-ML-Name: ruby-core X-Mail-Count: 83034 Subject: [ruby-core:83034] Re: [Ruby trunk Feature#13618] [PATCH] auto fiber schedule for rb_wait_for_single_fd and rb_waitpid X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" I've updated the series to support FIBER_USE_NATIVE=0 (along with the proposed fix for [Bug #13887]). The primary change for FIBER_USE_NATIVE=0 platforms is to move away from cross stack linked-list manipulation and use the heap for allocations, instead. This involved some structure modifications to make rb_thread_fd_select work on select(2)-based implementations. Of course, this increases the dependency on rb_ensure to release heap memory. FIBER_USE_NATIVE=1 platforms are still more important and faster, of course. I've tested on Debian 8.x and FreeBSD 11.0. Test reports from other platforms appricated, thank you Patch mbox (gzipped): https://80x24.org/spew/20170928004228.4538-1-e@80x24.org/t.mbox.gz ...or "git request-pull"-generated pull request: The following changes since commit d21aab2d3e007372973f2b803d7d8d7f9547f0cc: * 2017-09-28 (2017-09-27 21:55:33 +0000) are available in the git repository at: git://80x24.org/ruby thriber-copy for you to fetch changes up to 20ea4d710d3d75d946f74346e6a6f3616dac682d: thriber: non-native fiber support (2017-09-28 00:41:34 +0000) ---------------------------------------------------------------- Eric Wrong (3): thriber: green threads implemented using fibers thread_pthread: do not corrupt stack thriber: non-native fiber support common.mk | 9 + configure.in | 32 + cont.c | 173 ++-- fiber.h | 54 ++ include/ruby/io.h | 2 + iom.h | 95 +++ iom_common.h | 228 ++++++ iom_epoll.h | 710 ++++++++++++++++ iom_internal.h | 372 +++++++++ iom_kqueue.h | 907 +++++++++++++++++++++ iom_pingable_common.h | 49 ++ iom_select.h | 473 +++++++++++ prelude.rb | 12 + process.c | 15 +- signal.c | 39 +- .../wait_for_single_fd/test_wait_for_single_fd.rb | 62 ++ test/lib/leakchecker.rb | 9 + test/ruby/test_thriber.rb | 274 +++++++ thread.c | 76 +- thread_pthread.c | 10 +- vm.c | 9 + vm_core.h | 4 + 22 files changed, 3541 insertions(+), 73 deletions(-) create mode 100644 fiber.h create mode 100644 iom.h create mode 100644 iom_common.h create mode 100644 iom_epoll.h create mode 100644 iom_internal.h create mode 100644 iom_kqueue.h create mode 100644 iom_pingable_common.h create mode 100644 iom_select.h create mode 100644 test/ruby/test_thriber.rb