Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #16879
| From | "Patricia Shanahan" <patricia.shanahan@1:261/38.remove-x1c-this> |
|---|---|
| Subject | Re: How can you make idle processors pick up java work? |
| Message-ID | <50182C81.55847.calajapr@time.synchro.net> (permalink) |
| Newsgroups | comp.lang.java.programmer |
| References | <50182C81.55845.calajapr@time.synchro.net> |
| Date | 2012-07-31 20:07 +0000 |
| Organization | tds.net |
To: qwertmonkey From: "Patricia Shanahan" <patricia.shanahan@1:261/38.remove-dpk-this> To: qwertmonkey From: Patricia Shanahan <pats@acm.org> On 7/30/2012 4:27 PM, qwertmonkey@syberiaoutpost.ru wrote: >>> Is there a way to make these processors pick up/share work also, or >>> do you have to use some sort of scheduling framework on top of java? > >> Use multiple threads? > ~ > a) I need to actually scan large text files (10+ million lines). > b) On each line there is a NL sentence. > c) That processing should be run only once, but as fast as possible. > ~ > d) If you go: > d.1) int iPrx = Runtime.getRuntime().availableProcessors(); > d.2) count all lines > d.3) split the file in (total lines)/iPrx > d.4) then run iPrx threads (or executable instances using a batch script) > the time you waste on d.2) and d.3) will make all that strat senseless Why worry about splitting by actual line count, rather than by byte position in file? Patricia -+- BBBS/Li6 v4.10 Dada-1 + Origin: Prism bbs (1:261/38) -+- Synchronet 3.16a-Win32 NewsLink 1.98 Time Warp of the Future BBS - telnet://time.synchro.net:24 --- BBBS/Li6 v4.10 Dada-1 * Origin: Prism bbs (1:261/38) --- Synchronet 3.16a-Win32 NewsLink 1.98 Time Warp of the Future BBS - telnet://time.synchro.net:24
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
How can you make idle processors pick up java work? "qwertmonkey" <qwertmonkey@1:261/38.remove-x1c-this> - 2012-07-31 20:07 +0000 Re: How can you make idle processors pick up java work? "David Lamb" <david.lamb@1:261/38.remove-x1c-this> - 2012-07-31 20:07 +0000 Re: How can you make idle processors pick up java work? "Patricia Shanahan" <patricia.shanahan@1:261/38.remove-x1c-this> - 2012-07-31 20:07 +0000 Re: How can you make idle processors pick up java work? "Joshua Cranmer" <joshua.cranmer@1:261/38.remove-x1c-this> - 2012-07-31 20:07 +0000 Re: How can you make idle processors pick up java work? "John B. Matthews" <john.b..matthews@1:261/38.remove-x1c-this> - 2012-07-31 20:07 +0000
csiph-web