Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8545713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T12:51:22+00:00 2026-06-11T12:51:22+00:00

I want multiple threads to all fire at the same time. 10.times do Thread.new

  • 0

I want multiple threads to all fire at the same time.

10.times do
  Thread.new do
    sleep rand(5)               # Initialize all the stuff
    wait_for_all_other_threads  # Wait for other threads to initialize their stuff
    fire!                       # Go.
  end
end

How would I implement wait_for_all_other_threads so they all fire! at the same time?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T12:51:23+00:00Added an answer on June 11, 2026 at 12:51 pm

    Use a barrier sync: http://rubygems.org/gems/barrier/

    A call to barrier will cause each thread to block until all of the threads have called it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am new to threads. I want to communicate with multiple sensors at one
all! I want to create multiple threads in my application. I' using following code
There are multiple threads working on a task. Once a thread succeeds all of
I have multiple threads, and I want each thread to wait for every others
I want to run multiple threads simultaneously, and wait until all of them are
Hi I am new to python and want to create multiple threads in a
I want to write a method that run multiple threads and I want before
I want to pass a pre-built Map to multiple threads that are going to
I want to update a single datarow in a datatable using multiple threads. Is
Suppose I'm accessing a DataTable from multiple threads. If I want to access a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.