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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T06:32:18+00:00 2026-05-31T06:32:18+00:00

I have multiple actions running at the same time. When Action 1 is finished

  • 0

I have multiple actions running at the same time. When Action 1 is finished – it’s followed up by Action Nr.2, then 3, then 1 or 9 or 9 again or 10 or 7… in random sequence.

enter image description here

I need to:

  1. Store data which I get as the result of the Action/activity.

  2. Retrieve This data when the same Action continues!

I can identify actions:

  • by the unique ID

Here is how I imagine it:

  1. Start program.

  2. First step is to check if Data for new Activity exists – for that reason we grab ID and do the checking.

  3. Since it’s our new/first Action/Activity there isn’t any past data, so by the end of the action we create and save new data into some kind of dynamic storage.

    string[,] ID123 = new string[2, 3] { { “120”, “200”, “#ffc90e” }, { “380”, “200”, “#22b14c” } };

  4. When Action 1 is finished, Action 2 starts, Practically, we do the same as what we did in p.3.

    string[,] ID456789 = new string[2, 3] { { “10”, “5”, “#40” }, { “6”, “8”, “#80” } };

  5. Now it’s Activity 1 again! We identify it by the unique ID. This time, if we search for existing data- we will find this:

    string[,] ID123 = new string[2, 3] { { “120”, “200”, “#ffc90e” }, { “380”, “200”, “#22b14c” } };

  6. Now I do some editing + adding new values if needed. Continue.

One of the simplest solutions that I’ve thought of was – to simply create a temporary file with the “ID.txt” name. Unfortunatelly I’ll be having up to 10-15 actions running at the same time so this approach won’t be as fast as if I just recorded everything into memory.. The question is – how do I do it? sql? txt?

Some facts:

  • ID are always different for different Activities

  • I don’t know precise Activity count (varies between 10 and 15)

  • I’ll need to store an array type data, i.e.

string[,] array: 1, 15, 32, 12

2, 11, efg, 0

5, 9, 5, abc

…

  • similar question: Dynamic array in C#

  • there will be some conditions in my code that will trigger “data removal”, actions have a lifespan 😉

  • 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-31T06:32:19+00:00Added an answer on May 31, 2026 at 6:32 am

    It’s unclear what you’re trying to accomplish here, where and how actions enter this chain and how you need to deal with them.

    As far as keeping track of what’s currently in process, all you need is proper concurrency. There are several objects built into .NET 4.0 that you can use, or you can create your own. Since this data is dynamic, it probably shouldn’t be persisted, unless you expect your process to be able to pick up exactly where it left off after being terminated. So, you could, for example, use a ConcurrentDictionary<string, string[,]> that will store two-dimensional arrays, keyed by an ID string which must be unique within the Dictionary (even if the arrays of two IDs have the same dimensions and values). Concurrency-checking is built-in, meaning you can have multiple threads performing multiple actions against this Dictionary without worrying about “race conditions” where two threads may attempt to read or write the same thing at the same time.

    Be aware that data in memory as part of your process will cease to exist when the process ends, for whatever reason. If you don’t want that to happen, you can have a thread whose job it is to persist the ConcurrentDictionary’s contents to a file or database. Since it’s one thread, reading from a thread-safe collection of data, the problems of concurrencies in file writing are largely avoided AS LONG AS one record in the ConcurrentDictionary doesn’t depend upon data in another (you can still deal with cases where one record does depend on another, but it gets more complex). This thread can be “kicked off” during the performance of other actions, or based on a Timer, or whatever you choose to meet your needs.

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

Sidebar

Related Questions

I have multiple threads who all need to write to the same Dictionary. I
I have multiple NSURLConnections running providing data back to the delegate objects. Is it
I have a controller action that aggregates data from multiple sources: web service, database,
I have multiple chunks of code similar to the following: void GetPerson(Action<PersonView, Exception> callback);
I have multiple web services (WCF) running in IIS. When the services are warm
We have multiple log files like database log, weblog, quartzlog in our application. Any
I have multiple (8) WAR files and 1 EAR file that I want to
I have multiple themes on my website and users can just switch between multiple
I have multiple DIVs containing an image in each. When I rollover these DIVs,
I have multiple databases that I connect to using SQL*Plus in Windows (not the

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.