Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Thread scheduler for light weight concurrency. #3032

Merged
merged 1 commit into from May 14, 2020

Conversation

@ioquatix
Copy link
Member

ioquatix commented Apr 14, 2020

Please see https://bugs.ruby-lang.org/issues/16786 for discussion.

@ioquatix ioquatix force-pushed the ioquatix:thread-scheduler branch 4 times, most recently from fb56759 to 10282c4 Apr 14, 2020
@MSP-Greg
Copy link
Contributor

MSP-Greg commented Apr 14, 2020

@ioquatix

Maybe sometihing like the following in test/io/nonblock/http.rb and test/io/nonblock/test_http.rb:

http = Net::HTTP.new uri.host, uri.port
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
body = http.get(uri.path).body

Seemed to work in my fork...

@ioquatix
Copy link
Member Author

ioquatix commented Apr 14, 2020

@MSP-Greg thanks, it's 4AM and that code really helps me out.

@ioquatix ioquatix force-pushed the ioquatix:thread-scheduler branch 2 times, most recently from 3769ff6 to 3e86fe4 Apr 14, 2020
@MSP-Greg
Copy link
Contributor

MSP-Greg commented Apr 14, 2020

Now that I'm awake, a block might be better...

Net::HTTP.start(uri.host, uri.port) do |http|
  # ...
end
@ioquatix ioquatix force-pushed the ioquatix:thread-scheduler branch from d914aec to 2a5a6f5 Apr 15, 2020
@ioquatix
Copy link
Member Author

ioquatix commented Apr 15, 2020

Now that I'm awake...

@MSP-Greg I'm pretty sure I was not awake last night when trying to write that code lol...

@ioquatix ioquatix force-pushed the ioquatix:thread-scheduler branch from 2a5a6f5 to 1cd9da6 Apr 15, 2020
@ioquatix ioquatix force-pushed the ioquatix:thread-scheduler branch from 64e41e7 to 4641d0a May 8, 2020
@ioquatix
Copy link
Member Author

ioquatix commented May 8, 2020

I have rebased on master.

@ioquatix ioquatix force-pushed the ioquatix:thread-scheduler branch from 4641d0a to dba06a1 May 14, 2020
@ioquatix ioquatix merged commit 0e3b0fc into ruby:master May 14, 2020
96 checks passed
96 checks passed
gcc-10
Details
make (check, --jit)
Details
make (check)
Details
check_branch
Details
make (check, ubuntu-latest)
Details
make (test, windows-2019, 2019)
Details
make (check)
Details
gcc-9
Details
make (check, --jit-wait)
Details
make (check, ubuntu-16.04)
Details
make (test-bundler)
Details
gcc-8
Details
make (test-bundler, ubuntu-latest)
Details
make (test-bundled-gems)
Details
gcc-7
Details
make (test-bundled-gems, ubuntu-latest)
Details
make (leaked-globals)
Details
gcc-6
Details
make (test-all TESTS=--repeat-count=2, ubuntu-latest)
Details
gcc-5
Details
make (leaked-globals, ubuntu-latest)
Details
gcc-4.8
Details
clang-11
Details
clang-10
Details
clang-9
Details
clang-8
Details
clang-7
Details
clang-6.0
Details
clang-5.0
Details
clang-4.0
Details
clang-3.9
Details
c99
Details
c11
Details
c17
Details
c2x
Details
c++98
Details
c++11
Details
c++14
Details
c++17
Details
c++2a
Details
-O0
Details
-O3
Details
gmp
Details
jemalloc
Details
valgrind
Details
coroutine=ucontext
Details
coroutine=copy
Details
disable-mathn
Details
disable-jit-support
Details
disable-dln
Details
disable-rubygems
Details
OPT_THREADED_CODE=1
Details
OPT_THREADED_CODE=2
Details
OPT_THREADED_CODE=3
Details
NDEBUG
Details
RUBY_DEBUG
Details
ARRAY_DEBUG
Details
BUGNUM_DEBUG
Details
CCAN_LIST_DEBUG
Details
CPDEBUG=-1
Details
ENC_DEBUG
Details
GC_DEBUG
Details
HASH_DEBUG
Details
ID_TABLE_DEBUG
Details
RGENGC_DEBUG=-1
Details
SYMBOL_DEBUG
Details
THREAD_DEBUG=-1
Details
RGENGC_CHECK_MODE
Details
TRANSIENT_HEAP_CHECK_MODE
Details
VM_CHECK_MODE
Details
USE_EMBED_CI=0
Details
USE_FLONUM=0
Details
USE_LAZY_LOAD
Details
USE_RINCGC=0
Details
USE_SYMBOL_GC=0
Details
USE_THREAD_CACHE=0
Details
USE_TRANSIENT_HEAP=0
Details
DEBUG_FIND_TIME_NUMGESS
Details
DEBUG_INTEGER_PACK
Details
ENABLE_PATH_CHECK
Details
GC_DEBUG_STRESS_TO_CLASS
Details
GC_ENABLE_LAZY_SWEEP=0
Details
GC_PROFILE_DETAIL_MEMOTY
Details
GC_PROFILE_MORE_DETAIL
Details
CALC_EXACT_MALLOC_SIZE
Details
MALLOC_ALLOCATED_SIZE_CHECK
Details
IBF_ISEQ_ENABLE_LOCAL_BUFFER
Details
RGENGC_ESTIMATE_OLDMALLOC
Details
RGENGC_FORCE_MAJOR_GC
Details
RGENGC_OBJ_INFO
Details
RGENGC_OLD_NEWOBJ_CHECK
Details
RGENGC_PROFILE
Details
VM_DEBUG_BP_CHECK
Details
VM_DEBUG_VERIFY_METHOD_CACHE
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.