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 6A06E209B8 for ; Tue, 12 Sep 2017 05:40:37 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id B5A8F1208BD; Tue, 12 Sep 2017 14:40:35 +0900 (JST) Received: from dcvr.yhbt.net (dcvr.yhbt.net [64.71.152.64]) by neon.ruby-lang.org (Postfix) with ESMTPS id B24DA1208B4 for ; Tue, 12 Sep 2017 14:40:31 +0900 (JST) Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 879DC209B8; Tue, 12 Sep 2017 05:40:27 +0000 (UTC) Date: Tue, 12 Sep 2017 05:40:27 +0000 From: Eric Wrong To: ruby-core@ruby-lang.org Message-ID: <20170912054027.GA13706@whir> References: <20170831055815.GA4537@starla> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20170831055815.GA4537@starla> X-ML-Name: ruby-core X-Mail-Count: 82756 Subject: [ruby-core:82756] 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" Eric Wrong wrote: > mame@ruby-lang.org wrote: > > I believe that this feature should be introduced with another > > name. I have no counterproposal, though. Sorry. > > What about Thriber? Or Fred? > > "Fread" might be confused with fread(3) function, and I don't > know anybody named "Fred", so it is a safe name to choose :) OK, "class Fred" occurs in object.c documentation already, so maybe it is confusing. So I choose Thriber as a name: https://80x24.org/spew/20170912053032.13622-1-e@80x24.org/raw That patch contains the latest version of this feature rebased against ko1's recent execution context changes in trunk (up to r59844) along with some bugfixes (infinite wait fix). It also adds rb_thread_fd_select as a scheduling point (in addition to rb_wait_for_single_fd and rb_waitpid from previously published patches). Only lightly tested, more tests will need to be written... Naming is hard :< Pull request available below for git users: The following changes since commit 65b11a04f10a2438f0d6ba263a78d16367c3aac0: console.c: set winsize on Windows (2017-09-11 20:10:34 +0000) are available in the git repository at: git://80x24.org/ruby thriber for you to fetch changes up to d9c0095537c3c01d2187e783910cdc92d6c545fc: thriber: green threads implemented using fibers (2017-09-12 05:29:31 +0000) ---------------------------------------------------------------- Eric Wrong (1): thriber: green threads implemented using fibers common.mk | 7 + configure.in | 32 + cont.c | 123 ++- include/ruby/io.h | 2 + iom.h | 95 +++ iom_common.h | 204 +++++ iom_epoll.h | 697 ++++++++++++++++ iom_internal.h | 280 +++++++ iom_kqueue.h | 899 +++++++++++++++++++++ iom_pingable_common.h | 54 ++ iom_select.h | 448 ++++++++++ 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 | 5 + vm.c | 9 + vm_core.h | 4 + 21 files changed, 3324 insertions(+), 22 deletions(-) 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 -- Mr. Wrong