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

  • Home
  • SEARCH
  • 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 7029765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:34:53+00:00 2026-05-28T00:34:53+00:00

This is the revised version of my previous question Paralleling trading software The code

  • 0

This is the revised version of my previous question Paralleling trading software

The code is:

foreach (Strategy strategy in strategies)
{
    strategy.AllTablesUpdated();
    Console.WriteLine("All tables updated in " + sw.ElapsedMilliseconds);
}

...........

public override void AllTablesUpdated()
{
    lock (desiredOrdersBuy)
    ....

And the output is:

All tables updated in 0
All tables updated in 0
All tables updated in 0
All tables updated in 0
All tables updated in 0
All tables updated in 0
All tables updated in 0
All tables updated in 0
All tables updated in 0
All tables updated in 0
All tables updated in 0
All tables updated in 0
All tables updated in 0
All tables updated in 0
All tables updated in 9
All tables updated in 9
All tables updated in 9
All tables updated in 9
All tables updated in 23
All tables updated in 35
All tables updated in 35
All tables updated in 35
All tables updated in 35
All tables updated in 35
All tables updated in 35
All tables updated in 43
All tables updated in 43
All tables updated in 43
All tables updated in 44
All tables updated in 44
All tables updated in 44
All tables updated in 44
All tables updated in 44
All tables updated in 58
All tables updated in 65
All tables updated in 65
All tables updated in 78
All tables updated in 78
All tables updated in 78
All tables updated in 78
All tables updated in 78
All tables updated in 78
All tables updated in 78
All tables updated in 78
All tables updated in 87
All tables updated in 95
All tables updated in 111
All tables updated in 111
All tables updated in 111
All tables updated in 136
All tables updated in 153
All tables updated in 153
All tables updated in 171
All tables updated in 171
All tables updated in 178
All tables updated in 178
All tables updated in 178
All tables updated in 178
All tables updated in 178
All tables updated in 178
All tables updated in 178

The issue is – when certain strategy waits for lock to be release other strategies waits too.

I think I should replace lock with Monitor.TryEnter and AllTablesUpdated should return boolean (false if it need to be relaunched because lock was not obtained).

Also I think I need 4-6 parallel threads to execute “AllTablesUpdated” method to use the power of multicore processors. How to create these threads?

  • 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-28T00:34:54+00:00Added an answer on May 28, 2026 at 12:34 am

    You can use Parallel.ForEach to do something with each of your Strategy-Objects in a seperated Thread

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

Sidebar

Related Questions

This is a revised/better written version of the question I asked earlier today --
Okay this is a revised question from earlier today, I have included code to
REVISED QUESTION : We have tracked this down to a custom add to cart
Revised Code jQuery(function($) { $(#filter).keyup(function () { var filter = $(this).val(), count = 0;
This is the revised version. It takes 3.5GB memory and the pop function doesn't
Revised version of question: cat - | tr a-z A-Z | tr A-Z a-z
See Edit below initial question for a revised version of the original problem Using
UPDATE: Solved. Thanks BusyMark! EDIT: This is revised based on the answer below from
This might seem like a stupid question I admit. But I'm in a small
This is a difficult and open-ended question I know, but I thought I'd throw

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.