Re: Request/discussion: BufferedReader reading using async API while providing sync API

2016-10-27 Thread Brunoais
that provide such interface I mentioned although they require a slightly different treatment (and different constants). On 27/10/2016 00:06, Vitaly Davidovich wrote: On Wednesday, October 26, 2016, Brunoais <brunoa...@gmail.com <mailto:brunoa...@gmail.com>> wrote: It is ac

Re: Request/discussion: BufferedReader reading using async API while providing sync API

2016-10-25 Thread Brunoais
o and when is supposed to interrupt Thread.sleep()? Sorry, I'm not following. Could you please explain how this is supposed to work? On 24 Oct 2016, at 15:59, Brunoais <brunoa...@gmail.com> wrote: Attached and sending! On 24/10/2016 13:48, Pavel Rappo wrote: Could you please send a new em

Re: Request/discussion: BufferedReader reading using async API while providing sync API

2016-10-27 Thread Brunoais
... On 27/10/2016 11:47, Vitaly Davidovich wrote: On Thursday, October 27, 2016, Brunoais <brunoa...@gmail.com <mailto:brunoa...@gmail.com>> wrote: Did you read the C code? I looked at the Linux code in the JDK. Have you got any idea how many functions Windows or L

Re: Request/discussion: BufferedReader reading using async API while providing sync API

2016-10-27 Thread Brunoais
at. On 26/10/2016 21:41, Peter Levart wrote: On 10/26/2016 09:46 PM, Brunoais wrote: Thank you. Only one thing left. How can I "burn" the OS' file read cache? I only know how to do that by allocating a very large amount of memory based on the information I see in the resourc

Re: Request/discussion: BufferedReader reading using async API while providing sync API

2016-10-26 Thread Brunoais
s case, I have no idea how much memory each one's computer has so I cannot use the same method. How would you do such program excerpt? As for the rest of the pointers: thank you I'll start building the benchmark code based on that information. On 26/10/2016 18:24, Peter Levart wrote: Hi Bruno

Re: Request/discussion: BufferedReader reading using async API while providing sync API

2016-10-27 Thread Brunoais
Here's my current code for benchmarking. Does this seem correct to you? On 27/10/2016 14:55, Peter Levart wrote: On 10/27/2016 03:48 PM, Peter Levart wrote: On 10/27/2016 02:20 PM, Brunoais wrote: Hey. Any idea how to skip tests? When testing for BufferedInputStream

Re: Request/discussion: BufferedReader reading using async API while providing sync API

2016-10-27 Thread Brunoais
syscalls are emitted (you should be seeing plain read()'s there, with FileInputStream and FileChannel). On Thu, Oct 27, 2016 at 9:06 AM, Brunoais <brunoa...@gmail.com <mailto:brunoa...@gmail.com>> wrote: Thanks for the heads up. I'll try that later. These tests are

Re: Request/discussion: BufferedReader reading using async API while providing sync API

2016-10-29 Thread Brunoais
limit. On my hardware, the best speed I got was with 655360B for the new ones. Any more than that was not producing any visible results. I guess it is due to the speed data was processing for the test. On 28/10/2016 09:16, Brunoais wrote: I'll try going back to a previous version I worked on which

Re: Request/discussion: BufferedReader reading using async API while providing sync API

2016-10-23 Thread Brunoais
it on the list later. Thanks, -Pavel On 21 Oct 2016, at 18:56, Brunoais <brunoa...@gmail.com> wrote: Pavel is right. In reality, I was expecting such BufferedReader to use only a single buffer and have that Buffer being filled asynchronously, not in a different Thread. Additionally, I don'

Re: Request/discussion: BufferedReader reading using async API while providing sync API

2016-10-21 Thread Brunoais
, Brunoais wrote: Hi, I looked at BufferedReader source code for java 9 long with the source code of the channels/streams used. I noticed that, like in java 7, BufferedReader does not use an Async API to load data from files, instead, the data loading is all done synchronously even when the OS allows

Re: Request/discussion: BufferedReader reading using async API while providing sync API

2016-10-21 Thread Brunoais
as it is a BufferedReader. We can do it, but it needs to be investigated not only for your favorite OS but for other OSes as well. Feel free to prototype this and we can discuss it on the list later. Thanks, -Pavel On 21 Oct 2016, at 18:56, Brunoais <brunoa...@gmail.com> wrote: Pavel is right. In real

Re: Request/discussion: BufferedReader reading using async API while providing sync API

2016-10-21 Thread Brunoais
). On 21/10/2016 18:38, Roger Riggs wrote: Hi Pavel, I think Brunoais asking for a double buffering scheme in which the implementation of BufferReader fills (a second buffer) in parallel with the application reading from the 1st buffer and managing the swaps and async reads transparently

Re: Request/discussion: BufferedReader reading using async API while providing sync API

2016-10-24 Thread Brunoais
Attached and sending! On 24/10/2016 13:48, Pavel Rappo wrote: Could you please send a new email on this list with the source attached as a text file? On 23 Oct 2016, at 19:14, Brunoais <brunoa...@gmail.com> wrote: Here's my poc/prototype: http://pastebin.com/WRpYWDJF I've imple

Re: Request/discussion: BufferedReader reading using async API while providing sync API

2016-11-23 Thread Brunoais
Hey! Is this forgotten? On 03/11/2016 14:35, Brunoais wrote: Any information you can give on this? On 29/10/2016 19:10, Brunoais wrote: Here's my try on going async. On my tests on my local windows 10 machine (I don't have access to the linux one without a VM ATM) , now with 1GB file, I

Re: Java is too limited when dealing with the Console

2016-11-15 Thread Brunoais
, You might find an open source package like JLine would have the full featured terminal support you are looking for. http://jline.sourceforge.net/ Roger On 11/13/2016 5:35 AM, Brunoais wrote: Since java 6, a class named Console was created. This class allows reading and writing directly

Re: Java is too limited when dealing with the Console

2016-11-15 Thread Brunoais
such API natively. On 15/11/2016 18:09, Brunoais wrote: jLine requires a .dll on windows making it not OS agnostic. If this existed in java itself, this problem would not be a problem because java internal dll are signed by java and can be included without issues. But then, why doesn't java have

Java is too limited when dealing with the Console

2016-11-13 Thread Brunoais
Since java 6, a class named Console was created. This class allows reading and writing directly to the console, including getting input without echoing for password purposes. Unfortunately, that class does not include useful functionality for java programs to work on the console and output

Re: Request/discussion: BufferedReader reading using async API while providing sync API

2016-11-03 Thread Brunoais
Any information you can give on this? On 29/10/2016 19:10, Brunoais wrote: Here's my try on going async. On my tests on my local windows 10 machine (I don't have access to the linux one without a VM ATM) , now with 1GB file, I noticed: ~2s of speed improvement from BufferedInputStream

Re: Request/discussion: BufferedReader reading using async API while providing sync API

2016-10-28 Thread Brunoais
On 27/10/2016 22:45, Vitaly Davidovich wrote: On Thursday, October 27, 2016, Brunoais <brunoa...@gmail.com <mailto:brunoa...@gmail.com>> wrote: You are right. Even in windows it does not set the flags for async reads. It seems like it is windows itself that does

Re: Request/discussion: BufferedReader reading using async API while providing sync API

2016-10-27 Thread Brunoais
for the heads up. On 27/10/2016 13:53, Vitaly Davidovich wrote: On Thu, Oct 27, 2016 at 8:34 AM, Brunoais <brunoa...@gmail.com <mailto:brunoa...@gmail.com>> wrote: Oh... I see. In that case, it means something is terribly wrong. It can be my initial tests, though. I'm tes

Re: Request/discussion: BufferedReader reading using async API while providing sync API

2016-10-26 Thread Brunoais
when the buffer is nearly empty and any byte of data is welcome "at any cost". Besides, whomever called read at that point would also have had an availability() of 0 and still called read()/read(byte[]). On 26/10/2016 06:14, Bernd Eckenfels wrote: Hallo Brunoais, In the past

Re: Request/discussion: BufferedReader reading using async API while providing sync API

2016-10-28 Thread Brunoais
. David On 28/10/2016 5:08 AM, Brunoais wrote: You are right. Even in windows it does not set the flags for async reads. It seems like it is windows itself that does the decision to buffer the contents based on its own heuristics. But... Why? Why won't it be? Why is there no API for it? How am I

Re: Request/discussion: BufferedReader reading using async API while providing sync API

2016-10-26 Thread Brunoais
number of iterations) 4.1 (the configuration) Can someone please point me in the right direction? On 26/10/2016 07:57, Brunoais wrote: Hey Bernd! I don't know how far back you did such thing but I'm getting positive results with my non-JMH tests. I do have to evaluate my results against logic

Re: Request/discussion: BufferedReader reading using async API while providing sync API

2016-10-26 Thread Brunoais
the buffer and the channel hasn't encountered EOF. Is that right? On 25 Oct 2016, at 22:16, Brunoais <brunoa...@gmail.com> wrote: Thank you for your time. I'll try to explain it. I hope I can clear it up. First of it, I made a meaning mistake between asynchronous and non-blocking. This imp

Re: Request/discussion: BufferedReader reading using async API while providing sync API

2016-10-26 Thread Brunoais
You didn't need to Thank you, I'll use it. On 26/10/2016 21:41, Peter Levart wrote: On 10/26/2016 09:46 PM, Brunoais wrote: Thank you. Only one thing left. How can I "burn" the OS' file read cache? I only know how to do that by allocating a very large amount of me

Request/discussion: BufferedReader reading using async API while providing sync API

2016-10-13 Thread Brunoais
Hi, I'm new here, so if this is belongs to a different mailing list please point me in the right direction. I looked at BufferedReader source code for java 9 long with the source code of the channels/streams used. I noticed that, like in java 7, BufferedReader does not use an Async API to load

Request/discussion: BufferedReader reading using async API while providing sync API

2016-10-13 Thread Brunoais
Hi, I looked at BufferedReader source code for java 9 long with the source code of the channels/streams used. I noticed that, like in java 7, BufferedReader does not use an Async API to load data from files, instead, the data loading is all done synchronously even when the OS allows