Click here to Skip to main content
16,008,490 members
Home / Discussions / C#
   

C#

 
Question.NET 3.5 redistributable package Pin
ptr2void20-May-08 3:33
ptr2void20-May-08 3:33 
AnswerRe: .NET 3.5 redistributable package Pin
Kel_20-May-08 4:15
Kel_20-May-08 4:15 
AnswerRe: .NET 3.5 redistributable package Pin
Ed.Poore20-May-08 4:23
Ed.Poore20-May-08 4:23 
QuestionWhen is a customAttribute constructor of ... : System.Attribute called/activated Pin
petermeter20-May-08 2:46
petermeter20-May-08 2:46 
AnswerRe: When is a customAttribute constructor of ... : System.Attribute called/activated Pin
led mike20-May-08 4:26
led mike20-May-08 4:26 
GeneralRe: When is a customAttribute constructor of ... : System.Attribute called/activated Pin
petermeter20-May-08 8:52
petermeter20-May-08 8:52 
AnswerRe: When is a customAttribute constructor of ... : System.Attribute called/activated Pin
PIEBALDconsult20-May-08 15:07
mvePIEBALDconsult20-May-08 15:07 
Questiondata structure design for data aggregation Pin
George_George20-May-08 2:44
George_George20-May-08 2:44 
Hello everyone,


I want to learn from your advice about how to design data structure in the following scenario to be most efficient.

One thread will create data (composed of ID and content), and output to a queue or something (data structure could be chosen to make the scenario more efficient), the data created is very frequently working to produce data, another thread is responsible to aggregate data (for the same ID, aggregate the content and output to a file), and aggregation thread works less frequently -- sleep 10 minutes, aggregate and then sleep again.

I am going to find a solution which could balance,

1. Less performance impact to the data creating thread;
2. To make data aggregation thread works as efficient as possible and consume less memory.

Any advice about how to design data structures?

Currently,

- I am stupidly using a List, appending data by the data creation thread, and I think appending data to the List is less performance impact to data create thread than using Dictionary to insert. Am I correct?

- Read data from begin to end of another thread -- using ID as key into a Dictionary, since there maybe duplicate ID, so when I insert into the Dictionary, I will check if contains key, if yes, I will update the data, or else insert a new one;

- Using lock on the whole List to make thread safe. Does the lock on the whole List is too heavy?

Any smarter ways? Smile | :)


thanks in advance,
George
AnswerRe: data structure design for data aggregation Pin
Christian Wikander20-May-08 3:09
Christian Wikander20-May-08 3:09 
GeneralRe: data structure design for data aggregation Pin
George_George20-May-08 3:28
George_George20-May-08 3:28 
GeneralRe: data structure design for data aggregation Pin
Christian Wikander20-May-08 3:32
Christian Wikander20-May-08 3:32 
GeneralRe: data structure design for data aggregation Pin
George_George21-May-08 0:30
George_George21-May-08 0:30 
QuestionExample code that takes as its first argument one of the words 'sum,' 'product,' 'mean,' or 'sqrt' and for further arguments a series of numbers. The program applies the appropriate function to the series. Pin
smileguy20-May-08 2:25
smileguy20-May-08 2:25 
AnswerRe: Example code that takes as its first argument one of the words 'sum,' 'product,' 'mean,' or 'sqrt' and for further arguments a series of numbers. The program applies the appropriate function to the series. Pin
phannon8620-May-08 2:36
professionalphannon8620-May-08 2:36 
AnswerGood luck with your homework. Pin
CPallini20-May-08 2:36
mveCPallini20-May-08 2:36 
AnswerRe: Example code that takes as its first argument one of the words 'sum,' 'product,' 'mean,' or 'sqrt' and for further arguments a series of numbers. The program applies the appropriate function to the series. Pin
Colin Angus Mackay20-May-08 2:38
Colin Angus Mackay20-May-08 2:38 
AnswerRe: Example code that takes as its first argument one of the words 'sum,' 'product,' 'mean,' or 'sqrt' and for further arguments a series of numbers. The program applies the appropriate function to the series. Pin
Dan Neely20-May-08 2:59
Dan Neely20-May-08 2:59 
AnswerRe: Example code that takes as its first argument one of the words 'sum,' 'product,' 'mean,' or 'sqrt' and for further arguments a series of numbers. The program applies the appropriate function to the series. Pin
Christian Graus20-May-08 3:05
protectorChristian Graus20-May-08 3:05 
AnswerRe: Example code that takes as its first argument one of the words 'sum,' 'product,' 'mean,' or 'sqrt' and for further arguments a series of numbers. The program applies the appropriate function to the series. Pin
PIEBALDconsult20-May-08 15:01
mvePIEBALDconsult20-May-08 15:01 
GeneralRe: Example code that takes as its first argument one of the words 'sum,' 'product,' 'mean,' or 'sqrt' and for further arguments a series of numbers. The program applies the appropriate function to the series. Pin
The Nightcoder23-May-08 16:15
The Nightcoder23-May-08 16:15 
GeneralRe: Example code that takes as its first argument one of the words 'sum,' 'product,' 'mean,' or 'sqrt' and for further arguments a series of numbers. The program applies the appropriate function to the series. Pin
PIEBALDconsult23-May-08 16:25
mvePIEBALDconsult23-May-08 16:25 
QuestionNew Methods for existing types? Pin
Reelix20-May-08 2:22
Reelix20-May-08 2:22 
AnswerRe: New Methods for existing types? Pin
ptr2void20-May-08 2:25
ptr2void20-May-08 2:25 
GeneralRe: New Methods for existing types? Pin
Reelix20-May-08 2:31
Reelix20-May-08 2:31 
AnswerRe: New Methods for existing types? Pin
CPallini20-May-08 2:34
mveCPallini20-May-08 2:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.