Click here to Skip to main content
15,888,254 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

Please give an idea to solve my poblem.
I will get the data from a hardware device is about 3 milli secs fast by a call back function. Whenever I recieve the data into my class library, I fill into a linked list not to over write. I will adopt that linked list "static object" from my UI using a thread. In this scenario, I am getting the data perfectly if I use a single thread. If any other threads are running in this UI, all the threads are running slow. Please help me , what might be the reason ?
I kept thread priority also, but no use.

Regards,
KV Subrahmanyam,
CMC ltd, Hyderabad.
Posted

1 solution

If you are using a single static linked list for all the threads to offload onto, then the likelihood is they are having to wait for each other to finish and the linked list is released for the next one to write to.

You will have to come up with another mechanism for all the data to be collected on, e.g. a pool of list or stacks, and then have a another thread that does all the cleanup and centralising the data.

Maybe you will need to have twice (a guess) the number of linked lists to threads and round robin them to make sure a thread is never waiting for another.
 
Share this answer
 
Comments
SKOTAJI 7-Jan-11 9:21am    
Thanks Dave, I will refer that concept in Google. Can you please help in finding the any code on same.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900