Arokh
Well-known member
- Joined
- Apr 11, 2006
- Messages
- 124
Hi,
Im currently writing a application which calculates different hashes.
Every hash I "have" has inheritet the HashAlgorithm class and now
I want to use them to calculate those hashes.
And I want it to be calculated as fast as possible.
At first I thought it wouldnt be so hard to do so,
but I guess I was wrong.
Since I have 4 cores I wanted to make 4 threads.
Each thread would be responsible for calculating a hash.
Then I have a main loop which reads from the file,
then "passes" the data onto the threads,
and tell it to calculate the next part of the hash.
But I keep on having something like synchronisation problems.
And everytime I try to rewrite it I end up with something that doesnt work,
it is starting to frustrate me :-\ .
Is there a basic "guideline" I can use?
Im currently looking into a circular buffer.
If I fail again Ill post the code of it here,
so you can give some advice if you want.
Im currently writing a application which calculates different hashes.
Every hash I "have" has inheritet the HashAlgorithm class and now
I want to use them to calculate those hashes.
And I want it to be calculated as fast as possible.
At first I thought it wouldnt be so hard to do so,
but I guess I was wrong.
Since I have 4 cores I wanted to make 4 threads.
Each thread would be responsible for calculating a hash.
Then I have a main loop which reads from the file,
then "passes" the data onto the threads,
and tell it to calculate the next part of the hash.
But I keep on having something like synchronisation problems.
And everytime I try to rewrite it I end up with something that doesnt work,
it is starting to frustrate me :-\ .
Is there a basic "guideline" I can use?
Im currently looking into a circular buffer.
If I fail again Ill post the code of it here,
so you can give some advice if you want.