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 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 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 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 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 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 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
@github-actions
gcc-10
Details
@github-actions
make (check, --jit)
Details
@github-actions
make (check)
Details
@github-actions
check_branch
Details
@github-actions
make (check, ubuntu-latest)
Details
@github-actions
make (test, windows-2019, 2019)
Details
@github-actions
make (check)
Details
@github-actions
gcc-9
Details
@github-actions
make (check, --jit-wait)
Details
@github-actions
make (check, ubuntu-16.04)
Details
@github-actions
make (test-bundler)
Details
@github-actions
gcc-8
Details
@github-actions
make (test-bundler, ubuntu-latest)
Details
@github-actions
make (test-bundled-gems)
Details
@github-actions
gcc-7
Details
@github-actions
make (test-bundled-gems, ubuntu-latest)
Details
@github-actions
make (leaked-globals)
Details
@github-actions
gcc-6
Details
@github-actions
make (test-all TESTS=--repeat-count=2, ubuntu-latest)
Details
@github-actions
gcc-5
Details
@github-actions
make (leaked-globals, ubuntu-latest)
Details
@github-actions
gcc-4.8
Details
@github-actions
clang-11
Details
@github-actions
clang-10
Details
@github-actions
clang-9
Details
@github-actions
clang-8
Details
@github-actions
clang-7
Details
@github-actions
clang-6.0
Details
@github-actions
clang-5.0
Details
@github-actions
clang-4.0
Details
@github-actions
clang-3.9
Details
@github-actions
c++98
Details
@github-actions
c++11
Details
@github-actions
c++14
Details
@github-actions
c++17
Details
@github-actions
c++2a
Details
@github-actions
jemalloc
Details
@github-actions
valgrind
Details
@github-actions
coroutine=ucontext
Details
@github-actions
coroutine=copy
Details
@github-actions
disable-mathn
Details
@github-actions
disable-jit-support
Details
@github-actions
disable-dln
Details
@github-actions
disable-rubygems
Details
@github-actions
OPT_THREADED_CODE=1
Details
@github-actions
OPT_THREADED_CODE=2
Details
@github-actions
OPT_THREADED_CODE=3
Details
@github-actions
NDEBUG
Details
@github-actions
RUBY_DEBUG
Details
@github-actions
ARRAY_DEBUG
Details
@github-actions
BUGNUM_DEBUG
Details
@github-actions
CCAN_LIST_DEBUG
Details
@github-actions
CPDEBUG=-1
Details
@github-actions
ENC_DEBUG
Details
@github-actions
GC_DEBUG
Details
@github-actions
HASH_DEBUG
Details
@github-actions
ID_TABLE_DEBUG
Details
@github-actions
RGENGC_DEBUG=-1
Details
@github-actions
SYMBOL_DEBUG
Details
@github-actions
THREAD_DEBUG=-1
Details
@github-actions
RGENGC_CHECK_MODE
Details
@github-actions
TRANSIENT_HEAP_CHECK_MODE
Details
@github-actions
VM_CHECK_MODE
Details
@github-actions
USE_EMBED_CI=0
Details
@github-actions
USE_FLONUM=0
Details
@github-actions
USE_LAZY_LOAD
Details
@github-actions
USE_RINCGC=0
Details
@github-actions
USE_SYMBOL_GC=0
Details
@github-actions
USE_THREAD_CACHE=0
Details
@github-actions
USE_TRANSIENT_HEAP=0
Details
@github-actions
DEBUG_FIND_TIME_NUMGESS
Details
@github-actions
DEBUG_INTEGER_PACK
Details
@github-actions
ENABLE_PATH_CHECK
Details
@github-actions
GC_DEBUG_STRESS_TO_CLASS
Details
@github-actions
GC_ENABLE_LAZY_SWEEP=0
Details
@github-actions
GC_PROFILE_DETAIL_MEMOTY
Details
@github-actions
GC_PROFILE_MORE_DETAIL
Details
@github-actions
CALC_EXACT_MALLOC_SIZE
Details
@github-actions
MALLOC_ALLOCATED_SIZE_CHECK
Details
@github-actions
IBF_ISEQ_ENABLE_LOCAL_BUFFER
Details
@github-actions
RGENGC_ESTIMATE_OLDMALLOC
Details
@github-actions
RGENGC_FORCE_MAJOR_GC
Details
@github-actions
RGENGC_OBJ_INFO
Details
@github-actions
RGENGC_OLD_NEWOBJ_CHECK
Details
@github-actions
RGENGC_PROFILE
Details
@github-actions
VM_DEBUG_BP_CHECK
Details
@github-actions
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
Labels
None yet
3 participants