Click here to Skip to main content
15,891,684 members
Home / Discussions / C#
   

C#

 
GeneralRe: Another Question. Pin
Guffa7-Jan-07 9:54
Guffa7-Jan-07 9:54 
QuestionCookie-less Authentication Pin
Rahithi6-Jan-07 17:42
Rahithi6-Jan-07 17:42 
AnswerRe: Cookie-less Authentication Pin
Christian Graus6-Jan-07 20:04
protectorChristian Graus6-Jan-07 20:04 
QuestionIssues with RemoveChild() Pin
csharpk0der1236-Jan-07 17:23
csharpk0der1236-Jan-07 17:23 
AnswerRe: Issues with RemoveChild() Pin
Christian Graus6-Jan-07 20:07
protectorChristian Graus6-Jan-07 20:07 
AnswerRe: Issues with RemoveChild() Pin
Luc Pattyn7-Jan-07 9:15
sitebuilderLuc Pattyn7-Jan-07 9:15 
QuestionI cant seem to think today. Pin
Captain See Sharp6-Jan-07 16:56
Captain See Sharp6-Jan-07 16:56 
AnswerRe: I cant seem to think today. Pin
Luc Pattyn6-Jan-07 18:18
sitebuilderLuc Pattyn6-Jan-07 18: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 18:43
Captain See Sharp6-Jan-07 18:43 
GeneralRe: I cant seem to think today. Pin
Luc Pattyn6-Jan-07 19:02
sitebuilderLuc Pattyn6-Jan-07 19:02 
GeneralRe: I cant seem to think today. Pin
Captain See Sharp6-Jan-07 19:34
Captain See Sharp6-Jan-07 19:34 
GeneralRe: I cant seem to think today. Pin
Luc Pattyn6-Jan-07 20:04
sitebuilderLuc Pattyn6-Jan-07 20:04 
GeneralRe: I cant seem to think today. Pin
Captain See Sharp6-Jan-07 20:23
Captain See Sharp6-Jan-07 20:23 
GeneralRe: I cant seem to think today. Pin
Luc Pattyn6-Jan-07 20:27
sitebuilderLuc Pattyn6-Jan-07 20:27 
GeneralRe: I cant seem to think today. Pin
Captain See Sharp6-Jan-07 20:32
Captain See Sharp6-Jan-07 20:32 
GeneralRe: I cant seem to think today. Pin
Luc Pattyn6-Jan-07 20:53
sitebuilderLuc Pattyn6-Jan-07 20:53 
GeneralRe: I cant seem to think today. Pin
Captain See Sharp6-Jan-07 21:04
Captain See Sharp6-Jan-07 21:04 
GeneralRe: I cant seem to think today. Pin
Luc Pattyn7-Jan-07 7:20
sitebuilderLuc Pattyn7-Jan-07 7:20 
GeneralRe: I cant seem to think today. Pin
Captain See Sharp7-Jan-07 7:25
Captain See Sharp7-Jan-07 7:25 
GeneralRe: I cant seem to think today. Pin
Captain See Sharp7-Jan-07 7:34
Captain See Sharp7-Jan-07 7:34 
GeneralRe: I cant seem to think today. Pin
Luc Pattyn7-Jan-07 7:43
sitebuilderLuc Pattyn7-Jan-07 7:43 
GeneralRe: I cant seem to think today. Pin
Captain See Sharp7-Jan-07 7:59
Captain See Sharp7-Jan-07 7:59 
GeneralRe: I cant seem to think today. Pin
Luc Pattyn7-Jan-07 8:51
sitebuilderLuc Pattyn7-Jan-07 8:51 
GeneralRe: I cant seem to think today. Pin
Captain See Sharp7-Jan-07 9:29
Captain See Sharp7-Jan-07 9:29 
GeneralRe: I cant seem to think today. Pin
Luc Pattyn7-Jan-07 9:48
sitebuilderLuc Pattyn7-Jan-07 9: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.