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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T17:31:13+00:00 2026-05-24T17:31:13+00:00

I have an architecture that reads packets from a packetized binary file, assigns each

  • 0

I have an architecture that reads packets from a packetized binary file, assigns each packet to an individual processing pipeline based on the packet type, and reassembles the packets into a new file on the other side of the pipelines. Each pipeline contains blocking queues similar to this one.

There is a thread on each side of the blocking queue in each pipline that runs a loop that queues or dequeues packets. These threads are started asynchronously (i.e. “fire and forget” style) from a controller object. This controller object has a Dictionary<int, ChannelPipeline> collection that contains all of the pipeline objects.

Here’s my question: What mechanism can I put in place that will tell me when all of the pipelines have completed processing? There’s an EndOfData property on each pipeline; do I have to continuously poll that property on every pipeline until they all read true, or is there a better (i.e. more efficient) way?

  • 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-24T17:31:15+00:00Added an answer on May 24, 2026 at 5:31 pm

    If you know the total number of pipelines you can consider AutoResetEvent + integer counter

    AutoResetEvent allThreadsDone = new AutoResetEvent(false);
    int completedThreads;
    int scheduledThreads;
    

    basically each worker thread will increment it’s value used Interlocked.Increment() and set event in case when it is last thread:

    Interlocked.Increment(ref completedThreads);
    if (completedThreads == scheduledThreads)
    {
        allThreadsDone.Set();
    }
    

    In monitoring thread you just do:

     allThreadsDone.WaitOne();
       // here is we know that all threads are finished
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have read in Patterns of Enterprise Application Architecture that a Unit Of Work
I am new to ASP.net MVC architecture. I have read in some articles that
In a recent project I have nearly completed we used an architecture that as
I'm developing an application that reads data from a SQL server database (migrated from
I have to write an architecture case study but there are some things that
I am working within a enterprise architecture that is processing a large amount of
We have a large news-oriented site that has high web traffic. The architecture is
I have access to the HL7 Clinical Document Architecture, Release 2.0, which states that
I have a script that parses a file containing directories to other file, that
I took Computer Architecture course and I understood that processor has 32 registers each

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.