Re: Null-terminated Unicode strings in java.io on Windows

2008-01-25 Thread Robert Lougher
Hi Mark, On Jan 25, 2008 10:16 PM, Mark Wielaard <[EMAIL PROTECTED]> wrote: > Hi Robert, > > Robert Lougher <[EMAIL PROTECTED]> writes: > > This is getting a bit hostile for no reason Thinking about > > alignment gives an interesting solution. > > > > 1) Strings are not null-terminated > > 2)

Re: Null-terminated Unicode strings in java.io on Windows

2008-01-25 Thread Mark Wielaard
Hi Robert, Robert Lougher <[EMAIL PROTECTED]> writes: > This is getting a bit hostile for no reason Thinking about > alignment gives an interesting solution. > > 1) Strings are not null-terminated > 2) For most strings the alignment gives the VM room to terminate in > place when GetStringCha

Re: [PATCH] Move Solaris specific classes to solaris/

2008-01-25 Thread Alan Bateman
Roman Kennke wrote: Hi, there are some classes in the jdk/share tree, that seem to be Solaris specific. I suggest moving them to the jdk/solaris tree instead. Or am I wrong here? /Roman Yes, they should be in the src/solaris tree (although only DevPollSelectorProvider is Solaris specific).

[PATCH] Move Solaris specific classes to solaris/

2008-01-25 Thread Roman Kennke
Hi, there are some classes in the jdk/share tree, that seem to be Solaris specific. I suggest moving them to the jdk/solaris tree instead. Or am I wrong here? /Roman -- http://kennke.org/blog/ # HG changeset patch # User Roman Kennke <[EMAIL PROTECTED]> # Date 1201293270 -3600 # Node ID db9384d

Re: Null-terminated Unicode strings in java.io on Windows

2008-01-25 Thread Robert Lougher
On 1/25/08, Clemens Eisserer <[EMAIL PROTECTED]> wrote: > Hi there, > > > This is getting a bit hostile for no reason Thinking about > > alignment gives an interesting solution. > > > > 1) Strings are not null-terminated > > 2) For most strings the alignment gives the VM room to terminate in >

Re: Selector cleanup

2008-01-25 Thread Matthias Ernst
On Jan 25, 2008 2:59 PM, Alan Bateman <[EMAIL PROTECTED]> wrote: > > I not agree, reading the code, idle set is used when setInterestOps(0) > > is called. > > I'm not sure that case is not frequent. > I've only observed it on a few occasions. Hmm? I thought a boilerplate selection loop looks mor

Re: Null-terminated Unicode strings in java.io on Windows

2008-01-25 Thread Robert Lougher
Hi, Krzysztof Żelechowski-2 wrote: > > > Dnia 25-01-2008, Pt o godzinie 13:14 +, Mark Wielaard pisze: >> Krzysztof Żelechowski <[EMAIL PROTECTED]> writes: >> > If the specification gets fixed so that GSC result MUST be z-term, >> > your VM will cease being conformant >> > so it will be f

Re: Null-terminated Unicode strings in java.io on Windows

2008-01-25 Thread Clemens Eisserer
Hi there, > This is getting a bit hostile for no reason Thinking about > alignment gives an interesting solution. > > 1) Strings are not null-terminated > 2) For most strings the alignment gives the VM room to terminate in > place when GetStringChars is called > 3) Copy strings that can't be

Re: Null-terminated Unicode strings in java.io on Windows

2008-01-25 Thread Robert Lougher
Hi, This is getting a bit hostile for no reason Thinking about alignment gives an interesting solution. 1) Strings are not null-terminated 2) For most strings the alignment gives the VM room to terminate in place when GetStringChars is called 3) Copy strings that can't be terminated in place

Re: Null-terminated Unicode strings in java.io on Windows

2008-01-25 Thread Krzysztof Żelechowski
Dnia 25-01-2008, Pt o godzinie 18:44 +0100, Roman Kennke pisze: > Heyo, > > > > The specification is buggy > > > > in that it does not take into account the operating system interface > > > > and makes correct memory management inefficient > > > > for the benefit of sparing one byte per buffer

Re: Null-terminated Unicode strings in java.io on Windows

2008-01-25 Thread Krzysztof Żelechowski
Dnia 25-01-2008, Pt o godzinie 18:54 +0100, Roman Kennke pisze: > Hi, > > > Please observe: > > > > 1. > > the amount of memory needed to manage the allocation > > is greater than the number of bytes > > needed to store one additional character, > > so the relative impact on memory usage wi

Re: Null-terminated Unicode strings in java.io on Windows

2008-01-25 Thread Robert Lougher
Hi Chris, On 1/25/08, Krzysztof Żelechowski <[EMAIL PROTECTED]> wrote: > > Dnia 25-01-2008, Pt o godzinie 17:30 +, Robert Lougher pisze: > > No it doesn't. An implementation would have to be truly stupid to > > internally null-terminate. How many Strings are in the heap? How > > many will t

Re: Null-terminated Unicode strings in java.io on Windows

2008-01-25 Thread Roman Kennke
Hi, > Please observe: > > 1. > the amount of memory needed to manage the allocation > is greater than the number of bytes > needed to store one additional character, > so the relative impact on memory usage will not be dramatic. This is just ridiculous. An average Java app has tons of Strin

Re: Null-terminated Unicode strings in java.io on Windows

2008-01-25 Thread Roman Kennke
Heyo, > > The specification is buggy > > > in that it does not take into account the operating system interface > > > and makes correct memory management inefficient > > > for the benefit of sparing one byte per buffer > > > where an OS call is not needed. > > > Ridiculous. > > > > Tom Tromey

Re: Null-terminated Unicode strings in java.io on Windows

2008-01-25 Thread Krzysztof Żelechowski
Dnia 25-01-2008, Pt o godzinie 17:30 +, Robert Lougher pisze: > No it doesn't. An implementation would have to be truly stupid to > internally null-terminate. How many Strings are in the heap? How > many will the programmer access via GetStringChars? The null will be > a overhead for all S

Re: Null-terminated Unicode strings in java.io on Windows

2008-01-25 Thread Robert Lougher
On 1/25/08, Krzysztof Żelechowski <[EMAIL PROTECTED]> wrote: > > Dnia 25-01-2008, Pt o godzinie 17:08 +, Robert Lougher pisze: > > Hi, > > Hi-aye. > > > > > Apologies if you receive this twice. I sent it via nabble and it's > > now stuck awaiting moderation so I've subscribed. > > > > > > > >

Re: Null-terminated Unicode strings in java.io on Windows

2008-01-25 Thread Krzysztof Żelechowski
Dnia 25-01-2008, Pt o godzinie 18:19 +0100, Roman Kennke pisze: > Hi, > > > The specification is buggy > > in that it does not take into account the operating system interface > > and makes correct memory management inefficient > > for the benefit of sparing one byte per buffer > > where an OS

Re: Null-terminated Unicode strings in java.io on Windows

2008-01-25 Thread Krzysztof Żelechowski
Dnia 25-01-2008, Pt o godzinie 17:08 +, Robert Lougher pisze: > Hi, Hi-aye. > > Apologies if you receive this twice. I sent it via nabble and it's > now stuck awaiting moderation so I've subscribed. > > > > Dnia 25-01-2008, Pt o godzinie 13:14 +, Mark Wielaard pisze: > > Krzysztof Ż

Re: Null-terminated Unicode strings in java.io on Windows

2008-01-25 Thread Roman Kennke
Hi, > The specification is buggy > in that it does not take into account the operating system interface > and makes correct memory management inefficient > for the benefit of sparing one byte per buffer > where an OS call is not needed. > Ridiculous. Tom Tromey pointed out another possible pro

Re: Null-terminated Unicode strings in java.io on Windows

2008-01-25 Thread Roman Kennke
Hi, > The specification is buggy > in that it does not take into account the operating system interface > and makes correct memory management inefficient > for the benefit of sparing one byte per buffer > where an OS call is not needed. > Ridiculous. > The developers at Sun > found the correct way

Re: Null-terminated Unicode strings in java.io on Windows

2008-01-25 Thread Robert Lougher
Hi, Apologies if you receive this twice. I sent it via nabble and it's now stuck awaiting moderation so I've subscribed. Dnia 25-01-2008, Pt o godzinie 13:14 +, Mark Wielaard pisze: > Krzysztof Żelechowski <[EMAIL PROTECTED]> writes: > > If the specification gets fixed so that GSC result M

Re: Null-terminated Unicode strings in java.io on Windows

2008-01-25 Thread Alan Bateman
Roman Kennke wrote: Hi Alan, Am Montag, den 21.01.2008, 21:52 + schrieb Alan Bateman: : The GetStringChars implementation in HotSpot always returns a copy that is length+1 and zero terminated. There is a long-standing bug to clarify the JNI specification on this topic. I believe it sho

Re: Null-terminated Unicode strings in java.io on Windows

2008-01-25 Thread Mark Wielaard
Hi Roman, Roman Kennke <[EMAIL PROTECTED]> writes: > Hmm, I'm not talking about fixing the spec (I've read that bug report > while searching for clarfication on the spec actually). When the spec > doesn't tell _that_ the returned array is zero terminated, I think we > should assume that it isn't (a

Re: Selector cleanup

2008-01-25 Thread Alan Bateman
Rémi Forax wrote: : We have observed that a selector doesn't work well with a lot of keys. Is this just Windows? I ask because the Selector implementations on Solaris and Linux scale very well and there are many people using it on servers that are handling thousands of concurrent connections.

Re: Null-terminated Unicode strings in java.io on Windows

2008-01-25 Thread Krzysztof Żelechowski
Dnia 25-01-2008, Pt o godzinie 13:14 +, Mark Wielaard pisze: > Krzysztof Żelechowski <[EMAIL PROTECTED]> writes: > > If the specification gets fixed so that GSC result MUST be z-term, > > your VM will cease being conformant > > so it will be fixed and no additional buffers will be needed. >

Re: Selector cleanup

2008-01-25 Thread Rémi Forax
Alan Bateman a écrit : Rémi Forax wrote: ok, no valueOf(), i'm not an expert in Windows API. But are you agree that class FdMap is not necessary. I agree and I assume you will replace it with an embedded Map. I suspect it will be hard to see a difference (with the server VM anyway). i'am prett

Re: Null-terminated Unicode strings in java.io on Windows

2008-01-25 Thread Mark Wielaard
Krzysztof Żelechowski <[EMAIL PROTECTED]> writes: > If the specification gets fixed so that GSC result MUST be z-term, > your VM will cease being conformant > so it will be fixed and no additional buffers will be needed. Eh, that doesn't seem right at all. The specification currently doesn't gu