Currently i'm stuck up with the algorithm that i'm implementing, it's "lexicographic permutation algorithm", it "LAGS" when it comes to million of number ( 1 million to 9 million ) and sometimes "STUCK UP ( NOT RESPONDING )"
So the idea that i come up is to break it apart, so meaning to say use a partition..
example i have a number to be partition which is: 100, so... square root of (100) i can get 10,
so each process from 1 -10, carries 10 process.. because 100 / 10 = 10, and 10 x 10 = 100.. just to be clear.so
All in all = 100 process,
so using threading i guess i can solve this efficiently, so i did a benchmark between PLAIN LOOP vs. PARTITIONING WITH THREADING but somehow using partitioning with threading it "SLOWS" up the process and the PLAIN LOOP is much faster...
The class that i'm using threading is not implemented by me..
I uploaded the code.. hope someone can point me out what i'm missing and can help me fix up my problem.. any advice is also appreciated and welcome
I use vb.net 2010 in this..
My best regard and thank you
So the idea that i come up is to break it apart, so meaning to say use a partition..
example i have a number to be partition which is: 100, so... square root of (100) i can get 10,
so each process from 1 -10, carries 10 process.. because 100 / 10 = 10, and 10 x 10 = 100.. just to be clear.so
- loop 1: (carries 10 process )
- loop 2: (carries 10 process )
- loop 3: (carries 10 process )
- loop 4: (carries 10 process )
- loop 5: (carries 10 process )
- loop 6: (carries 10 process )
- loop 7: (carries 10 process )
- loop 8: (carries 10 process )
- loop 9: (carries 10 process )
- loop 10: (carries 10 process )
All in all = 100 process,
so using threading i guess i can solve this efficiently, so i did a benchmark between PLAIN LOOP vs. PARTITIONING WITH THREADING but somehow using partitioning with threading it "SLOWS" up the process and the PLAIN LOOP is much faster...
The class that i'm using threading is not implemented by me..
I uploaded the code.. hope someone can point me out what i'm missing and can help me fix up my problem.. any advice is also appreciated and welcome
I use vb.net 2010 in this..
My best regard and thank you
Attachments
Last edited by a moderator: