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 505967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:39:09+00:00 2026-05-13T06:39:09+00:00

What is the most efficient and fastest way to send message to a thread

  • 0

What is the most efficient and fastest way to send message to a thread (not process) that run in while(1) loop in c#/.net:

  1. Using a synchronized queue (such in Blocking Queues & Thread’s Communication in C#)

  2. Running a message loop Using Application.Run of systems winforms in the thread context and before running the application.run subscribe to an event that capture the messsage in the thread context.

  3. Using socket or named pipe to send the thread a message.

In Linux I am used to do this with unix domain sockets, what is the equivalent way to do it in windows? share memory file? named pipe?
What do you think?

  • 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-05-13T06:39:10+00:00Added an answer on May 13, 2026 at 6:39 am

    I’d use a producer/consumer queue, personally. That’s effectively what the WinForms message loop is, just in a Windows Forms-specific way.

    Note that if you’re able to use .NET 4.0, there are collections built into the framework which make this very easy. In particular, using a BlockingCollection<T> wrapped round a ConcurrentQueue<T> will do what you want.

    I wouldn’t personally use the GeeksCafe code – I’d encapsulate the producer/consumer nature into its own class which wraps a queue, rather than treating any queue in that way via extension methods. In particular, you need all parties to handle the queue correctly, which means it’s better to give it its own API in my view.

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

Sidebar

Related Questions

I am wondering what is the fastest, most efficient way (using JAVA) to search
What would be the fastest, most efficient way to implement a search method that
What is the most efficient (fastest) way to get a lower bound of zero?
Given the next vertex shader, what is the simplest, most efficient and fastest way
What is the fastest / most efficient way of getting all the distinct items
I am interested to find out what is the best/fastest (most efficient) way to
What is the most efficient (fastest) way to simultaneously read in two large files
Out of professional curiosity, what is the safest / fastest / most efficient way
I am trying to find the fastest and most efficient way to calculate slopes
What is the recommended or most efficient way (least code/fastest) to make a html

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.