Click here to Skip to main content
15,564,350 members
Home / Discussions / C#
   

C#

 
GeneralRe: Another Question. Pin
Guffa7-Jan-07 10:54
Guffa7-Jan-07 10:54 
QuestionCookie-less Authentication Pin
Rahithi6-Jan-07 18:42
Rahithi6-Jan-07 18:42 
AnswerRe: Cookie-less Authentication Pin
Christian Graus6-Jan-07 21:04
mveChristian Graus6-Jan-07 21:04 
QuestionIssues with RemoveChild() Pin
csharpk0der1236-Jan-07 18:23
csharpk0der1236-Jan-07 18:23 
AnswerRe: Issues with RemoveChild() Pin
Christian Graus6-Jan-07 21:07
mveChristian Graus6-Jan-07 21:07 
AnswerRe: Issues with RemoveChild() Pin
Luc Pattyn7-Jan-07 10:15
sitebuilderLuc Pattyn7-Jan-07 10:15 
QuestionI cant seem to think today. Pin
Captain See Sharp6-Jan-07 17:56
Captain See Sharp6-Jan-07 17:56 
AnswerRe: I cant seem to think today. Pin
Luc Pattyn6-Jan-07 19:18
sitebuilderLuc Pattyn6-Jan-07 19:18 
Hello again,

I have some thoughts about this:

1) I hope you dont go through all this if ProcessorCount==1
or maybe you should, just to make sure it is also correct in that case ?

2) in my experience it works a lot easier when you never use end, but instead
use end+1 (saves a lot of mistakes, and it fits the for-loop paradigma).

3) I would not try to divide the job in exactly even parts, when you split
100 in 48+52 it won't matter that much.

4) I would be very careful not to have data that resides in the same cache line
(more precisely in addresses that differ by less than the cache line size)
be written by different processors. It would cause a lot of invalidate,
flush and reload operations, and would be devastating for performance.
And yes this is hard to achieve in a high-level language.
I hope but am not absolutely sure, arrays are always allocated at
an address that is a multiple of a sufficiently high power of 2
(say a multiple of 256 B). You can check this somewhat by experimenting,
better is to have it specd somewhere, but I dont recall having seen that.

5) 3+4 together means: I would, still thinking of arrays, split on
boundaries that correspond to 256 B or more, hence round up to 64
when dealing with 4B ints, etc.

6) I do recall some Intel articles that suggested making structs artificially
larger when you can afford it, just to achieve my point 4 (e.g. for control
data, such as task control blocks).
One of them showed how you can really kill a multi-processor system: have
two threads do spin locks on 2 data items that belong to the same cache line !

7) on the other hand, if you over-align your data, you increase the possibility
of cache trashing; example: if you need repetitive access to only 1000 bytes,
but all these bytes are at a stride of 1KB, they would constantly miss in
a cache even as big as 2MB, since cache associativity nowadays is something
like 8-way, so there would only be 8 cache line candidates to cache the
requested data (the cache line candidate in each way being determined by
the lowest address bits (but excluding those that correspond to the
cache line width).

8) in conclusion, I suggest you use variables for your basic parameters
(such as number of processors, estimated safe allignment (my 256 B above), etc.
And once you have it running, just do some more experiments with slightly
different values for those variables, just to see what really helps.


Good luck, and please keep posting your progress.




Luc Pattyn

GeneralRe: I cant seem to think today. Pin
Captain See Sharp6-Jan-07 19:43
Captain See Sharp6-Jan-07 19:43 
GeneralRe: I cant seem to think today. Pin
Luc Pattyn6-Jan-07 20:02
sitebuilderLuc Pattyn6-Jan-07 20:02 
GeneralRe: I cant seem to think today. Pin
Captain See Sharp6-Jan-07 20:34
Captain See Sharp6-Jan-07 20:34 
GeneralRe: I cant seem to think today. Pin
Luc Pattyn6-Jan-07 21:04
sitebuilderLuc Pattyn6-Jan-07 21:04 
GeneralRe: I cant seem to think today. Pin
Captain See Sharp6-Jan-07 21:23
Captain See Sharp6-Jan-07 21:23 
GeneralRe: I cant seem to think today. Pin
Luc Pattyn6-Jan-07 21:27
sitebuilderLuc Pattyn6-Jan-07 21:27 
GeneralRe: I cant seem to think today. Pin
Captain See Sharp6-Jan-07 21:32
Captain See Sharp6-Jan-07 21:32 
GeneralRe: I cant seem to think today. Pin
Luc Pattyn6-Jan-07 21:53
sitebuilderLuc Pattyn6-Jan-07 21:53 
GeneralRe: I cant seem to think today. Pin
Captain See Sharp6-Jan-07 22:04
Captain See Sharp6-Jan-07 22:04 
GeneralRe: I cant seem to think today. Pin
Luc Pattyn7-Jan-07 8:20
sitebuilderLuc Pattyn7-Jan-07 8:20 
GeneralRe: I cant seem to think today. Pin
Captain See Sharp7-Jan-07 8:25
Captain See Sharp7-Jan-07 8:25 
GeneralRe: I cant seem to think today. Pin
Captain See Sharp7-Jan-07 8:34
Captain See Sharp7-Jan-07 8:34 
GeneralRe: I cant seem to think today. Pin
Luc Pattyn7-Jan-07 8:43
sitebuilderLuc Pattyn7-Jan-07 8:43 
GeneralRe: I cant seem to think today. Pin
Captain See Sharp7-Jan-07 8:59
Captain See Sharp7-Jan-07 8:59 
GeneralRe: I cant seem to think today. Pin
Luc Pattyn7-Jan-07 9:51
sitebuilderLuc Pattyn7-Jan-07 9:51 
GeneralRe: I cant seem to think today. Pin
Captain See Sharp7-Jan-07 10:29
Captain See Sharp7-Jan-07 10:29 
GeneralRe: I cant seem to think today. Pin
Luc Pattyn7-Jan-07 10:48
sitebuilderLuc Pattyn7-Jan-07 10:48 

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.