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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:05:12+00:00 2026-06-08T05:05:12+00:00

i have a program which process price data coming from the broker. the pseudo

  • 0

i have a program which process price data coming from the broker. the pseudo code are as follow:

 Process[] process = new Process[50];

 void tickEvent(object sender, EventArgs e)
 {
    int contractNumber = e.contractNumber;

    doPriceProcess(process[contractNumber], e);
 }

now i would like to use mutlithreading to speed up my program, if the data are of different contract number, i would like to fire off different threads to speed up the process. However if the data are from the same contract, i would like the program to wait until the current process finishes before i continue with the next data. How do i do it?

can you provide some code please?

thanks in advance~

  • 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-08T05:05:14+00:00Added an answer on June 8, 2026 at 5:05 am

    You have many high level architectural decissions to make here:

    How many ticks do you expect to come from that broker?

    After all, you should have some kind dispatcher here.

    Here is some simple description of what basically is to do:

    • Encapsulate the incoming ticks in packages, best
      single commands that have all the data needed

    • Have a queue where you can easily (and thread safe) can store those commands

    • Have a Dispatcher, that takes an item of the queue and assigns some worker
      to do the command (or let the command execute itself)

    • Having a worker, you can have multiple threads, processes or whatsoever
      to work multiple commands seemlessly

    • Maybe you want to do some dispatching already for the input queue, depending
      on how many requests you want to be able to complete per time unit.

    Here is some more information that can be helpful:

    Command pattern in C#

    Reactor pattern (with sample code)

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

Sidebar

Related Questions

I have a program which needs to invoke a process to perform an operation
I have a debugging program which I've written to attach to a process and
So I have a program which creates a child process and executes a command
I have written a program which works on huge set of data. My CPU
I have a python program which takes input from stdin. Now, I've to write
I have a program (process) which needs to listen on 3 ports... Two are
i have a program in c# which run some process for example generate.exe a.tif
I'm working on a program which reacts to events coming from an internet socket,
I have a program which executes constantly and I need to save data every
I have an Android program which has a RemoteService (different process) and the Application

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.