Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
0 votes
0 answers
32 views

Ruby on Rails, threading in DelayedJob workers

I'm working on a Ruby on Rails web project that runs on Puma server, also has several DelayedJob Workers on different servers. The project generates some special logs that i want to send to AWS Sqs ...
Ricardo Vila's user avatar
  • 1,646
1 vote
0 answers
76 views

ruby: multithreading in a docker container does not work

I tested ractors in ruby with docker and without this is my script ractors = [] Benchmark.bm do |x| x.report("Single thread:") do cpu_intensive_task cpu_intensive_task end x....
Michael's user avatar
  • 19
1 vote
0 answers
64 views

Does Ruby have problems with race conditions on local variables when working with threads? [duplicate]

I'm trying to learn more about threads in Ruby I'm running this code for 10 minutes, and every time I got the same result: index = 480000 def test threads = [] total_threads = 40000 ...
Phill's user avatar
  • 36
0 votes
0 answers
58 views

Ruby thread.join does not return when using curses gem

I'm trying to get the ruby curses gem to run with multiple threads (on Windows) to run a serial port: require 'serialport' require 'curses' include Curses init_screen start_color curs_set(0) noecho $...
Max's user avatar
  • 372
1 vote
0 answers
46 views

Why does the order of closing two IO pipes in two forks matter?

Running the following code in Ruby makes Process.wait p1 to hang indefinitely. This is seemingly because r1.eof? in the first subprocess does not get unblocked by w1.close in the parent process. r1, ...
maikovich's user avatar
  • 378
2 votes
1 answer
104 views

Ruby Thread Pool pausing on ThreadError.queue _empty

I am attempting to write a script that runs over subdirectories and analyze contents. I am using threadpool, which has dramatically improved performance. However, my script is pausing near completion, ...
Andrew Walz's user avatar
2 votes
0 answers
100 views

Fastlane concurrent builds

I'm getting an error in my Fastlane setup when I try to run two build lanes concurrently. Here's the relevant code: lane :builds do current_directory = Dir.pwd google_thread = Thread.new { ...
mohamed hamada's user avatar
0 votes
1 answer
61 views

Wrapping block of code in ruby Thread object

we need to implement in our gem feature that needs to inject piece of code into Thread.new block statement globally. Let's leave here discussion about why :) If I define something like: module ...
skrystos's user avatar
  • 107
6 votes
0 answers
335 views

ActiveRecord- Cannot expire connection

I have the following multithreaded code: pool.post do ActiveRecord::Base.connection_pool.with_connection do process end end where pool is a ThreadPoolExecutor from the concurrent-ruby ...
testing09's user avatar
  • 137
0 votes
1 answer
295 views

Concurrent Ruby- Thread Pool vs Promises

I currently have some code where I retrieve data from a bunch of URLs. At the moment, I'm doing this sequentially. In order to speed it up, I want to do this concurrently. To implement this, I'm using ...
testing09's user avatar
  • 137
2 votes
0 answers
87 views

Ruby crashes when embedded in a child thread

I had hoped this would have been an answer to this, but sadly, its not. I am trying to run a single copy of ruby inside a child thread and have it communicate with the main thread. The way the ...
nPn's user avatar
  • 16.6k
3 votes
0 answers
84 views

Pause embedded ruby interpreter and resume later

I am running an embedded ruby interpreter inside a simulator. I have wrapped the c api to the simulator so I can call it from ruby. Unfortunately there is no blocking call to tell the simulator to run,...
nPn's user avatar
  • 16.6k
0 votes
1 answer
75 views

What's the use of having a loop block inside Thread.new in ruby?

I am a beginner when it comes to multi-threading. I am trying to understand how Thread in ruby works, and saw this example from this website (Thread-safe Data Structures) require 'thread' queue = ...
Iggy's user avatar
  • 5,229
2 votes
1 answer
46 views

Ruby: Data to a file only being written / saved / visible after program terminates

I am running a thread that does a few things. It gets a float from an API Appends that number into a file Prints that number to the command terminal Repeats Code: price_file = File.open(...
seamus's user avatar
  • 2,811
0 votes
1 answer
187 views

ruby: object not cleaned by GC when it creates a thread

Class owning a thread doesn't get garbage collected I have a ruby service that needs to stream an object from S3 to somewhere else, the files get large and I don't want to store them as a file, so I ...
Jiig's user avatar
  • 95

15 30 50 per page
1
2 3 4 5
71