CF v1.0 SP3 QFE

  • Thread starter Thread starter John Roberts
  • Start date Start date
J

John Roberts

Hi,

Does anyone know the link to the CF v1.0 SP3 QFE for Platform Builder 5.0?

I have followed links to it from the archive but the links are now defunct.

On a different note, I'm sure I read somewhere that the CLR stores one copy
of identical strings such that:

lock("a")
{

}


could potentially block another thread that is also locking the same string.

Is that true?

If so, does it apply to string literals only or also to dynamically created
strings? For example:

string a = "a" + "b";

lock(a)
{

}

TIA,
- John
 
All literal strings are subject to interning which means all instances of
"a" in different parts of your code could point to the same object. What you
should do is lock on something other than a string. Typically you create
your own object e.g. Object o = new Object() and lock on o

I don't have a link to the qfe but you should try searching/browsing the ms
downloads. According to this it exists:
http://support.microsoft.com/default.aspx?scid=kb;en-us;890061

Cheers
Daniel
 
Thanks Daniel.

I couldn't find a standalone QFE but the 2004 'roll-up' seems to include it.
Thanks for your help.

http://www.microsoft.com/downloads/...f1-c0af-4836-97d7-378748be2627&DisplayLang=en

I was trying to determine if interning is carried out with dynamically
created strings - I guess it isn't.

My real motive is that I was thinking about ways to reduce the memory
requirement for storing a large number of description strings in in-memory
objects. One method would be to gzip the string but I had thought about
using a dictionary-based approach (by splitting the descriptions into words
and storing them as a sequence). I this might happen 'for free' if the CLR
kept only one copy of identical strings.

Your response led me to search for 'intern' and I found the
string.Intern(string) method. So:

string description="this that this that this that";
string[] split = description.Split(' ');
for(int i=0; i<split.Length; i++)
split = string.Intern(split);
description = null;

I'm assuming that once garbage collection has kicked out the garbage
generated by this example, I have a acheived a form of dictionary-based
compression. Considering that we have thousands of large description strings
to store with many repeated words, do you think this is a good approach?

Cheers,
- John
 
Personally I would not take your approach but I have nothing to base that
on, other than gut feeling (not sure it would perform and it certainly seems
over complex and relying on what I would consider internal implementation
details). If I did have many strings I would probably read them from a
backing sotore. But I don't want to mislead you with unfounded opinions.

My suggestion is to measure your app's performance/memory consumption and
only if there really is a problem and only once you identified that the
cause is the strings, you should look at alternatives. At that point (and
you may be there right now), post to the performance ng.

Cheers
Daniel
--
http://www.danielmoth.com/Blog/


John Roberts said:
Thanks Daniel.

I couldn't find a standalone QFE but the 2004 'roll-up' seems to include
it. Thanks for your help.

http://www.microsoft.com/downloads/...f1-c0af-4836-97d7-378748be2627&DisplayLang=en

I was trying to determine if interning is carried out with dynamically
created strings - I guess it isn't.

My real motive is that I was thinking about ways to reduce the memory
requirement for storing a large number of description strings in in-memory
objects. One method would be to gzip the string but I had thought about
using a dictionary-based approach (by splitting the descriptions into
words and storing them as a sequence). I this might happen 'for free' if
the CLR kept only one copy of identical strings.

Your response led me to search for 'intern' and I found the
string.Intern(string) method. So:

string description="this that this that this that";
string[] split = description.Split(' ');
for(int i=0; i<split.Length; i++)
split = string.Intern(split);
description = null;

I'm assuming that once garbage collection has kicked out the garbage
generated by this example, I have a acheived a form of dictionary-based
compression. Considering that we have thousands of large description
strings to store with many repeated words, do you think this is a good
approach?

Cheers,
- John



Daniel Moth said:
All literal strings are subject to interning which means all instances of
"a" in different parts of your code could point to the same object. What
you should do is lock on something other than a string. Typically you
create your own object e.g. Object o = new Object() and lock on o

I don't have a link to the qfe but you should try searching/browsing the
ms downloads. According to this it exists:
http://support.microsoft.com/default.aspx?scid=kb;en-us;890061

Cheers
Daniel
 
Back
Top