Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #28476
| X-Received | by 10.66.216.161 with SMTP id or1mr2657705pac.38.1400092691309; Wed, 14 May 2014 11:38:11 -0700 (PDT) |
|---|---|
| X-Received | by 10.140.97.166 with SMTP id m35mr39959qge.28.1400092691192; Wed, 14 May 2014 11:38:11 -0700 (PDT) |
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!c1no6671301igq.0!news-out.google.com!qf4ni926igc.0!nntp.google.com!c1no6671295igq.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail |
| Newsgroups | comp.lang.java.programmer |
| Date | Wed, 14 May 2014 11:38:10 -0700 (PDT) |
| In-Reply-To | <lkvl26$vls$1@gregory.bnet.hr> |
| Complaints-To | groups-abuse@google.com |
| Injection-Info | glegroupsg2000goo.googlegroups.com; posting-host=187.72.161.1; posting-account=JYMozwoAAABEzHlCeA5JjFY2Blld-MCb |
| NNTP-Posting-Host | 187.72.161.1 |
| References | <459ec56a-b369-4261-b819-a4f232362f74@googlegroups.com> <lkvl26$vls$1@gregory.bnet.hr> |
| User-Agent | G2/1.0 |
| MIME-Version | 1.0 |
| Message-ID | <59a3228e-41fe-46bb-8f68-8d120b54b7e9@googlegroups.com> (permalink) |
| Subject | Re: Upload using java nio |
| From | William Lopes <williamlopes.dev@gmail.com> |
| Injection-Date | Wed, 14 May 2014 18:38:11 +0000 |
| Content-Type | text/plain; charset=ISO-8859-1 |
| Xref | csiph.com comp.lang.java.programmer:28476 |
Show key headers only | View raw
Em quarta-feira, 14 de maio de 2014 08h46min14s UTC-3, Josip Almasi escreveu: > On 05/13/2014 08:37 PM, William Lopes wrote: > > > Hi, I'm building a network test with source code (basically) here: http://toolongdidntread.com/android/android-multipart-post-with-progress-bar/ > > > > > > My server contains a php script that contains just a field with name = $_FILES['uploaded_file']['name'] > > > > > > But, this java script file isn't very good, it is using the io lib, and I want change to the nio lib, because of the perfomance. > > > > I gave up nio because it introduces a number of platform specific > > troubles. 'Troubles' being both OS and JVM impl dependent. > > You may get OOM with bogus description. > > IBM JVM gives more precise OOM explanation, like was it ENOMEM or > > ENOBUFS, which gives you more info on how to tune OS. > > > > Furthermore, there's just a few nio methods that actually utilize proper > > OS functions in order to avoid unnecessary transfer between kernel mem > > and userspace mem. > > IIRC, with sun jvm on linux, I've found exactly one nio method that > > actually does the job. And apache mina did not use it:> So neither did > > software using it, many many server software. > > (netty does though) > > > > I have no idea how android nio works. > > > > But as the man said, nio is not faster than io - it all depends on other > > threads and their synchronization. > > In your case, setProgress() is blocking and synchronized. > > Blocking = transfer waits for bar to render. > > Synchronized = slow. > > > > Recommendiation: > > Make a thread to update progress bar(s). Let it have non-blocking calls > > to update volatile/atomic internal counter(s). Use these calls instead > > of setProgress(). Make it sleep for 100-1000 ms, then render bar(s). > > > > Regards... My network test is for android plataform, on my test already I modified like you said. Is a few better now, but I still wait found the answer of how use nio lib. Thank you!
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar | Unroll thread
Upload using java nio William Lopes <williamlopes.dev@gmail.com> - 2014-05-13 11:37 -0700
Re: Upload using java nio Arne Vajhøj <arne@vajhoej.dk> - 2014-05-13 20:37 -0400
Re: Upload using java nio William Lopes <williamlopes.dev@gmail.com> - 2014-05-13 18:38 -0700
Re: Upload using java nio William Lopes <williamlopes.dev@gmail.com> - 2014-05-13 18:38 -0700
Re: Upload using java nio Arne Vajhøj <arne@vajhoej.dk> - 2014-05-13 22:00 -0400
Re: Upload using java nio Arne Vajhøj <arne@vajhoej.dk> - 2014-05-13 22:08 -0400
Re: Upload using java nio William Lopes <williamlopes.dev@gmail.com> - 2014-05-13 19:35 -0700
Re: Upload using java nio markspace <markspace@nospam.nospam> - 2014-05-13 20:22 -0700
Re: Upload using java nio William Lopes <williamlopes.dev@gmail.com> - 2014-05-14 11:35 -0700
Re: Upload using java nio Josip Almasi <joe@vrspace.org> - 2014-05-14 13:46 +0200
Re: Upload using java nio William Lopes <williamlopes.dev@gmail.com> - 2014-05-14 11:38 -0700
csiph-web