in reply to Re: perl threads and dual core hyper-threading
in thread perl threads and dual core hyper-threading
That's is a O(2n!) (factorial) process where n is the number of threads.
It's just a minor detail (since O(n) is much better than O(n^2)), but I don't see where you get that factorial.
O( 2n + 2(n-1) + 2(n-2) + ... + 2(2) + 2(1) ) 2n + 2(n-1) + 2(n-2) + ... + 2(2) + 2(1) = 2(n + n-1 + n-2 + ... + 2 + 1) = 2(n*(n+1)/2) = n^2 + n = O( n^2 + n ) = O( n^2 )
Or if you ignore the fact that the list is shrinking:
O( n * 2n ) = O( 2n^2 ) = O( n^2 )
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: perl threads and dual core hyper-threading
by BrowserUk (Patriarch) on Apr 25, 2006 at 23:05 UTC |