Jump to content

Recommended Posts

Posted

Here's some psuedo code...

 

int[] ids = new int[1000];

string[] names = new string[1000]

 

for (int i = 0 ; i < 1000 ; i++)

{

// open customer001txt through customer999.txt

// update the id and name array avariables

}

 

This is a VERY simplified version.. the real project consists of opening up hundereds of encrypted database files that must be decrypted, parsed, and then arrays in the parent class/thread need to be updated with info...

 

The problem is the single thread version now works fine, but takes forever.. most of the burden is decrypting and unpacking the database files.. if I could multi-thread this I could cut down processing time big time I believe..

 

Right now I am trying to use QueueUserWorkItem() and just load up all the file names using the object state var.. but because my worker function is static, I cant figure out how to update the arrays in the parent thread safely..

 

This seems like it would be a fairly common task.. use threads to pull a bunch of information from hundereds of files/databases and populate a parent table/structure with info...

 

I'm not looking to be spoon fed, just a little guidance.

 

Can anyone point me in the right direction?

 

Please help.

 

Thanks!

 

More...

 

View All Our Microsoft Related Feeds

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...