Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #15311 > unrolled thread

Recommendations for Lightweight Threading?

Started by"Aaron W. Hsu" <arcfide@sacrideo.us>
First post2012-06-15 17:33 -0500
Last post2012-06-19 07:46 -0700
Articles 20 on this page of 84 — 19 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  Recommendations for Lightweight Threading? "Aaron W. Hsu" <arcfide@sacrideo.us> - 2012-06-15 17:33 -0500
    Re: Recommendations for Lightweight Threading? markspace <-@.> - 2012-06-15 15:55 -0700
      Re: Recommendations for Lightweight Threading? "Aaron W. Hsu" <arcfide@sacrideo.us> - 2012-06-15 18:12 -0500
        Re: Recommendations for Lightweight Threading? markspace <-@.> - 2012-06-15 16:31 -0700
          Re: Recommendations for Lightweight Threading? "Aaron W. Hsu" <arcfide@sacrideo.us> - 2012-06-15 20:00 -0500
          Re: Recommendations for Lightweight Threading? Robert Klemme <shortcutter@googlemail.com> - 2012-06-16 14:39 +0200
            Re: Recommendations for Lightweight Threading? Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-06-16 12:13 -0700
        Re: Recommendations for Lightweight Threading? Roedy Green <see_website@mindprod.com.invalid> - 2012-06-16 00:57 -0700
    Re: Recommendations for Lightweight Threading? Lew <lewbloch@gmail.com> - 2012-06-15 15:57 -0700
      Re: Recommendations for Lightweight Threading? "Aaron W. Hsu" <arcfide@sacrideo.us> - 2012-06-15 18:12 -0500
    Re: Recommendations for Lightweight Threading? Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-06-15 20:19 -0400
      Re: Recommendations for Lightweight Threading? "Aaron W. Hsu" <arcfide@sacrideo.us> - 2012-06-15 19:59 -0500
        Re: Recommendations for Lightweight Threading? Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-06-15 21:37 -0400
          Controlling the Garbage Collector "Aaron W. Hsu" <arcfide@sacrideo.us> - 2012-06-16 11:51 -0500
            Re: Controlling the Garbage Collector Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-06-16 14:24 -0400
              Re: Controlling the Garbage Collector markspace <-@.> - 2012-06-16 12:24 -0700
                Re: Controlling the Garbage Collector Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-06-16 13:14 -0700
                  Re: Controlling the Garbage Collector Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-06-16 16:35 -0400
                    Re: Controlling the Garbage Collector "Aaron W. Hsu" <arcfide@sacrideo.us> - 2012-06-16 19:43 -0500
                    Re: Controlling the Garbage Collector Wanja Gayk <brixomatic@yahoo.com> - 2012-06-23 13:36 +0200
                      Re: Controlling the Garbage Collector Robert Klemme <shortcutter@googlemail.com> - 2012-06-23 15:39 +0200
                  Re: Controlling the Garbage Collector markspace <-@.> - 2012-06-16 14:34 -0700
            Re: Controlling the Garbage Collector Robert Klemme <shortcutter@googlemail.com> - 2012-06-18 04:32 -0700
              Re: Controlling the Garbage Collector Roedy Green <see_website@mindprod.com.invalid> - 2012-06-24 14:31 -0700
            Re: Controlling the Garbage Collector Arne Vajhøj <arne@vajhoej.dk> - 2012-06-20 21:19 -0400
              Re: Controlling the Garbage Collector "Aaron W. Hsu" <arcfide@sacrideo.us> - 2012-06-21 13:24 -0500
                Re: Controlling the Garbage Collector Lew <lewbloch@gmail.com> - 2012-06-21 11:37 -0700
                  Re: Controlling the Garbage Collector Fred Greer <fggreer@nospam.invalid> - 2012-06-21 21:20 +0000
                Re: Controlling the Garbage Collector Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-06-21 15:24 -0400
                Re: Controlling the Garbage Collector Robert Klemme <shortcutter@googlemail.com> - 2012-06-21 23:46 +0200
                  Re: Controlling the Garbage Collector Jukka Lahtinen <jtfjdehf@hotmail.com.invalid> - 2012-06-25 15:28 +0300
                    Re: Controlling the Garbage Collector Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-06-25 09:05 -0400
                      Re: Controlling the Garbage Collector Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2012-06-25 17:01 +0000
                        Re: Controlling the Garbage Collector Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-06-25 13:45 -0400
                          Re: Controlling the Garbage Collector Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-06-25 13:49 -0400
                          Re: Controlling the Garbage Collector Robert Klemme <shortcutter@googlemail.com> - 2012-06-25 20:41 +0200
                            Re: Controlling the Garbage Collector Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2012-06-26 12:25 +0000
                              Re: Controlling the Garbage Collector Robert Klemme <shortcutter@googlemail.com> - 2012-06-26 06:46 -0700
                                Re: Controlling the Garbage Collector Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2012-06-26 16:26 +0000
                                  Re: Controlling the Garbage Collector Eric Sosman <esosman@ieee-dot-org.invalid> - 2012-06-26 13:07 -0400
                                    Re: Controlling the Garbage Collector Robert Klemme <shortcutter@googlemail.com> - 2012-06-26 22:28 +0200
                                    Re: Controlling the Garbage Collector Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2012-06-26 23:49 +0000
                                      Re: Controlling the Garbage Collector Lew <lewbloch@gmail.com> - 2012-06-26 18:20 -0700
                                        Re: Controlling the Garbage Collector Highway to Hell <HtH49439112@gmail.com> - 2012-06-26 21:52 -0400
                                          Re: Controlling the Garbage Collector Gene Wirchenko <genew@ocis.net> - 2012-06-26 20:01 -0700
                                            Re: Controlling the Garbage Collector Highway to Hell <HtH49439112@gmail.com> - 2012-06-26 23:23 -0400
                                              Re: Controlling the Garbage Collector Gene Wirchenko <genew@ocis.net> - 2012-06-27 09:05 -0700
                                                Re: Controlling the Garbage Collector Martin Gregorie <martin@address-in-sig.invalid> - 2012-06-27 20:15 +0000
                                                  Re: Controlling the Garbage Collector Gene Wirchenko <genew@ocis.net> - 2012-06-27 13:52 -0700
                                                  Re: Controlling the Garbage Collector Lew <lewbloch@gmail.com> - 2012-06-27 13:41 -0700
                                                    Re: Controlling the Garbage Collector Gene Wirchenko <genew@ocis.net> - 2012-06-27 19:02 -0700
                                                    Re: Controlling the Garbage Collector Martin Gregorie <martin@address-in-sig.invalid> - 2012-06-28 21:45 +0000
                                                      Re: [OT] Driver's license restrictions (Was: Controlling the Garbage Collector) Lew <lewbloch@gmail.com> - 2012-06-28 15:16 -0700
                                                        Re: [OT] Driver's license restrictions (Was: Controlling the Garbage Collector) Martin Gregorie <martin@address-in-sig.invalid> - 2012-06-29 02:10 +0000
                                                        Re: [OT] Driver's license restrictions (Was: Controlling the Garbage Collector) Gene Wirchenko <genew@ocis.net> - 2012-06-28 19:57 -0700
                                                          Re: [OT] Driver's license restrictions glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-06-29 04:06 +0000
                                                            Re: [OT] Driver's license restrictions Tim Slattery <Slattery_T@bls.gov> - 2012-06-29 08:35 -0400
                                                          Re: [OT] Driver's license restrictions (Was: Controlling the Garbage Collector) Tim Slattery <Slattery_T@bls.gov> - 2012-06-29 08:33 -0400
                                                      Re: Controlling the Garbage Collector Tim Slattery <Slattery_T@bls.gov> - 2012-06-29 08:30 -0400
                                                        Re: Controlling the Garbage Collector Martin Gregorie <martin@address-in-sig.invalid> - 2012-06-29 23:04 +0000
                                                Re: Controlling the Garbage Collector Highway to Hell <HtH49439112@gmail.com> - 2012-06-27 16:53 -0400
                                              Re: Controlling the Garbage Collector Leif Roar Moldskred <leifm@dimnakorr.com> - 2012-06-27 11:32 -0500
                                                Re: Controlling the Garbage Collector Highway to Hell <HtH49439112@gmail.com> - 2012-06-27 16:54 -0400
                                          Re: Controlling the Garbage Collector Lew <lewbloch@gmail.com> - 2012-06-27 11:45 -0700
                                            Re: Controlling the Garbage Collector Highway to Hell <HtH49439112@gmail.com> - 2012-06-27 16:55 -0400
                                        Re: Controlling the Garbage Collector glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-06-27 02:06 +0000
                                      Re: Controlling the Garbage Collector Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2012-06-27 16:34 +0000
                                      Re: Controlling the Garbage Collector Leif Roar Moldskred <leifm@dimnakorr.com> - 2012-06-27 11:45 -0500
                                      Re: Controlling the Garbage Collector Wanja Gayk <brixomatic@yahoo.com> - 2012-07-02 11:21 +0200
                              Re: Controlling the Garbage Collector Lew <lewbloch@gmail.com> - 2012-06-26 13:52 -0700
                                Re: Controlling the Garbage Collector Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> - 2012-06-26 23:40 +0000
                                  Re: Controlling the Garbage Collector Lew <lewbloch@gmail.com> - 2012-06-26 16:48 -0700
                Re: Controlling the Garbage Collector markspace <-@.> - 2012-06-21 15:15 -0700
                  Re: Controlling the Garbage Collector Lew <lewbloch@gmail.com> - 2012-06-21 15:33 -0700
                    Re: Controlling the Garbage Collector "Aaron W. Hsu" <arcfide@sacrideo.us> - 2012-06-21 21:24 -0500
                Re: Controlling the Garbage Collector markspace <-@.> - 2012-06-21 15:23 -0700
          Re: Recommendations for Lightweight Threading? Wanja Gayk <brixomatic@yahoo.com> - 2012-06-17 15:49 +0200
      Re: Recommendations for Lightweight Threading? Roedy Green <see_website@mindprod.com.invalid> - 2012-06-16 01:00 -0700
        Re: Recommendations for Lightweight Threading? Roedy Green <see_website@mindprod.com.invalid> - 2012-06-16 01:04 -0700
    Re: Recommendations for Lightweight Threading? Wanja Gayk <brixomatic@yahoo.com> - 2012-06-16 04:03 +0200
    Re: Recommendations for Lightweight Threading? Kevin McMurtrie <mcmurtrie@pixelmemory.us> - 2012-06-15 22:27 -0700
      Re: Recommendations for Lightweight Threading? Robert Klemme <shortcutter@googlemail.com> - 2012-06-16 14:39 +0200
        Re: Recommendations for Lightweight Threading? Kevin McMurtrie <mcmurtrie@pixelmemory.us> - 2012-06-18 19:37 -0700
          Re: Recommendations for Lightweight Threading? Robert Klemme <shortcutter@googlemail.com> - 2012-06-19 07:46 -0700

Page 4 of 5 — ← Prev page 1 2 3 [4] 5  Next page →


#15676 — Re: Controlling the Garbage Collector

FromHighway to Hell <HtH49439112@gmail.com>
Date2012-06-27 16:53 -0400
SubjectRe: Controlling the Garbage Collector
Message-ID<jsfrsp$k21$1@speranza.aioe.org>
In reply to#15663
On 27/06/2012 12:05 PM, Gene Wirchenko wrote:
>       It is a tool that he says he knows how to use.
>
>> who chooses differently than him, in that and several other arenas.
>
>       It is a rational choice if you know how to use a manual
> transmission.

Ah, so, you simply have the same elitist opinion he does. I see.

[toc] | [prev] | [next] | [standalone]


#15666 — Re: Controlling the Garbage Collector

FromLeif Roar Moldskred <leifm@dimnakorr.com>
Date2012-06-27 11:32 -0500
SubjectRe: Controlling the Garbage Collector
Message-ID<98KdnTiKdagBqHbSnZ2dnUVZ8gmdnZ2d@giganews.com>
In reply to#15651
Highway to Hell <HtH49439112@gmail.com> wrote:

> I beg your *freaking* pardon? "Sniff! It's a rational blah blah for 
> those of us skilled enough blah blah" is about as 
> intellectually-snobbish as it gets. He clearly looks down on everyone 
> who chooses differently than him, in that and several other arenas.

Knowing how to drive stick is _intellectually_ snobbish? 

-- 
Leif Roar Moldskred

[toc] | [prev] | [next] | [standalone]


#15677 — Re: Controlling the Garbage Collector

FromHighway to Hell <HtH49439112@gmail.com>
Date2012-06-27 16:54 -0400
SubjectRe: Controlling the Garbage Collector
Message-ID<jsfrtr$k21$2@speranza.aioe.org>
In reply to#15666
On 27/06/2012 12:32 PM, Leif Roar Moldskred wrote:
> Highway to Hell <HtH49439112@gmail.com> wrote:
>
>> I beg your *freaking* pardon? "Sniff! It's a rational blah blah for
>> those of us skilled enough blah blah" is about as
>> intellectually-snobbish as it gets. He clearly looks down on everyone
>> who chooses differently than him, in that and several other arenas.
>
> Knowing how to drive stick is _intellectually_ snobbish?

No, saying "Sniff! ... those of us skilled enough ..." is intellectually 
snobbish.


[toc] | [prev] | [next] | [standalone]


#15672 — Re: Controlling the Garbage Collector

FromLew <lewbloch@gmail.com>
Date2012-06-27 11:45 -0700
SubjectRe: Controlling the Garbage Collector
Message-ID<d4ac1ead-bd85-41e9-9e33-d6964ad809bc@googlegroups.com>
In reply to#15641
On Tuesday, June 26, 2012 6:52:30 PM UTC-7, Highway to Hell wrote:
> On 26/06/2012 9:20 PM, Lew wrote:
> > Nope.
> >
> > My car was $800.00 less expensive with a manual transmission than with
> > an automatic transmission. Manual gets better fuel economy. It gives better
> > control over the vehicle, especially in inclement weather. You can drop to
> > a lower gear and accelerate to pass more readily.
> >
> > Subconscious distrust of complicated technology, indeed! Sniff! It's a
> > rational economic decision for those of us skilled enough to drive a manual
> > transmission.
> 
> Why am I not surprised that you'd not only have one, but be snobbish 
> about it?

You seriously need to grow a sense of humor.

I suppose mine goes right over your head, based on your response.

Your snarkiness does not change the fact that the choice of a manual 
transmission is a rational economic decision, and making that point 
does not constitute snobbery, you silly troll, you.

-- 
Lew

[toc] | [prev] | [next] | [standalone]


#15678 — Re: Controlling the Garbage Collector

FromHighway to Hell <HtH49439112@gmail.com>
Date2012-06-27 16:55 -0400
SubjectRe: Controlling the Garbage Collector
Message-ID<jsfrvp$k21$3@speranza.aioe.org>
In reply to#15672
On 27/06/2012 2:45 PM, Lew wrote:
> On Tuesday, June 26, 2012 6:52:30 PM UTC-7, Highway to Hell wrote:
>> On 26/06/2012 9:20 PM, Lew wrote:
>>> Nope.
>>>
>>> My car was $800.00 less expensive with a manual transmission than with
>>> an automatic transmission. Manual gets better fuel economy. It gives better
>>> control over the vehicle, especially in inclement weather. You can drop to
>>> a lower gear and accelerate to pass more readily.
>>>
>>> Subconscious distrust of complicated technology, indeed! Sniff! It's a
>>> rational economic decision for those of us skilled enough to drive a manual
>>> transmission.
>>
>> Why am I not surprised that you'd not only have one, but be snobbish
>> about it?
>
> You seriously need to grow a sense of humor.

How ironic.

> I suppose mine goes right over your head, based on your response.

What humor?

> Your snarkiness does not change the fact that the choice of a manual
> transmission is a rational economic decision, and making that point
> does not constitute snobbery, you silly troll, you.

Who is "you silly troll, you"? There is nobody here by that name. ;)

[toc] | [prev] | [next] | [standalone]


#15642 — Re: Controlling the Garbage Collector

Fromglen herrmannsfeldt <gah@ugcs.caltech.edu>
Date2012-06-27 02:06 +0000
SubjectRe: Controlling the Garbage Collector
Message-ID<jsdprg$mre$1@speranza.aioe.org>
In reply to#15640
Lew <lewbloch@gmail.com> wrote:

(snip)
> My car was $800.00 less expensive with a manual transmission than with  
> an automatic transmission. Manual gets better fuel economy. It gives better 
> control over the vehicle, especially in inclement weather. You can drop to 
> a lower gear and accelerate to pass more readily.

A little off topic, but...

Rumors are that automatics are now good enough to, in most cases,
get as good or better fuel economy. The computer is better at
figuring out what gear to be in and when than most, if not all,
drivers. 

I am not so sure about the inclement weather or passing.
I probably believe that with enough practice you do better,
but without, which is most people, worse. (Passing is almost
a lost art with the number of four lane or more freeways.)

If you don't have enough practice, having to shift while
passing can be distracting from watching for cars coming
the other way.

-- glen

[toc] | [prev] | [next] | [standalone]


#15667 — Re: Controlling the Garbage Collector

FromAndreas Leitgeb <avl@gamma.logic.tuwien.ac.at>
Date2012-06-27 16:34 +0000
SubjectRe: Controlling the Garbage Collector
Message-ID<slrnjumdhi.u9l.avl@gamma.logic.tuwien.ac.at>
In reply to#15633
Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> wrote:
> Eric Sosman <esosman@ieee-dot-org.invalid> wrote:
>> On 6/26/2012 12:26 PM, Andreas Leitgeb wrote:
>>> Oh, seems I got the motivation wrong, then.  If that was your point,
>>> then obviously my essay didn't address that.  My motivation was having
>>> some large objects, whose memory could be explicitly freed, as soon as
>>> the memory was no longer needed in the program.
>>      And my question, still, is "Why?"
> Why do some people prefer cars with manual gear shift?
> Maybe a (sub)conscious distrust in complicated technology...

Eric, did this and the discussion it triggered answer your question?

[toc] | [prev] | [next] | [standalone]


#15668 — Re: Controlling the Garbage Collector

FromLeif Roar Moldskred <leifm@dimnakorr.com>
Date2012-06-27 11:45 -0500
SubjectRe: Controlling the Garbage Collector
Message-ID<ye6dnfE8bclbpXbSnZ2dnUVZ8jOdnZ2d@giganews.com>
In reply to#15633
Andreas Leitgeb <avl@gamma.logic.tuwien.ac.at> wrote:
> 
> Why do some people prefer cars with manual gear shift?

Price, fuel economy, they're better suited to hilly terrain, lower
maintenance costs, better ("tighter") acceleration and some people
find cars with manual transmissions more fun to drive. 

-- 
Leif Roar Moldskred

[toc] | [prev] | [next] | [standalone]


#15782 — Re: Controlling the Garbage Collector

FromWanja Gayk <brixomatic@yahoo.com>
Date2012-07-02 11:21 +0200
SubjectRe: Controlling the Garbage Collector
Message-ID<MPG.2a5b835718f5d093989711@202.177.16.121>
In reply to#15633
In article <slrnjukijq.u9l.avl@gamma.logic.tuwien.ac.at>, 
avl@gamma.logic.tuwien.ac.at says...

> Why do some people prefer cars with manual gear shift?
> Maybe a (sub)conscious distrust in complicated technology...

I don't like my car to shift when my tires are squealing, as it 
unsettles the car, which is outright dangerous in this situation. ;-)

Apart from that: Manual shifting is fun.

Kind regards,
Wanja

-- 
..Alesi's problem was that the back of the car was jumping up and down 
dangerously - and I can assure you from having been teammate to 
Jean Alesi and knowing what kind of cars that he can pull up with, 
when Jean Alesi says that a car is dangerous - it is. [Jonathan Palmer]

--- Posted via news://freenews.netfront.net/ - Complaints to news@netfront.net ---

[toc] | [prev] | [next] | [standalone]


#15610 — Re: Controlling the Garbage Collector

FromLew <lewbloch@gmail.com>
Date2012-06-26 13:52 -0700
SubjectRe: Controlling the Garbage Collector
Message-ID<735a9a23-b608-4c60-872a-3b66792f20ed@googlegroups.com>
In reply to#15596
Andreas Leitgeb wrote:
> PS: I once had a task where some explicit System.gc() really helped.

Presumably because the combination of code idioms and GC strategies 
wasn't optimized.

>  I don't know why it is so vaguely defined ("suggests", rather
>  than "requests" a best effort...), but it did appear to work
>  well, anyway. Most of the other usecases for manual control should
>  be dealt with by Java7's try-with-resources.

It appeared to work because you used a JVM implementation that 
honored it and you didn't run it with the switch that ignores those calls.

Had either of those conditions not pertained, youd've had to actually fix 
the problem.

-- 
Lew

[toc] | [prev] | [next] | [standalone]


#15629 — Re: Controlling the Garbage Collector

FromAndreas Leitgeb <avl@gamma.logic.tuwien.ac.at>
Date2012-06-26 23:40 +0000
SubjectRe: Controlling the Garbage Collector
Message-ID<slrnjuki2g.u9l.avl@gamma.logic.tuwien.ac.at>
In reply to#15610
Lew <lewbloch@gmail.com> wrote:
> Andreas Leitgeb wrote:
>> PS: I once had a task where some explicit System.gc() really helped.
> Presumably because the combination of code idioms and GC strategies 
> wasn't optimized.

Genetic algorithm surely means something to you.
High and low tide, too, most likely. ;-)

In order to push the envelope just slightly, I had set heap size
to a bit more than physical memory size (to not have the program 
bomb out for the rare high peaks) but otherwise make sure that
memory consumption stays well below the maximum most of the time.
Doing System.gc() on the low-tide-points just simply did help
achieve that goal.  Other tricks may as well have existed,
they just didn't occur to me.

>>  I don't know why it is so vaguely defined ("suggests", rather
>>  than "requests" a best effort...), but it did appear to work
>>  well, anyway.
> It appeared to work because you used a JVM implementation that 
> honored it and you didn't run it with the switch that ignores those calls.
> Had either of those conditions not pertained, youd've had to actually fix 
> the problem.

Indeed, like unsetting that (mindless) switch or changing to a
JVM-implementation that does honor the "suggestions" ;-)

PS: is "youd've" any common? It was easy to understand, but I'd never
  before seen it written that way.  Most of Google's first-page hits
  seem to be discussions about how legal something like "you'd've"
  would be. Only hit for "youd've" is in a youtube-video title.

[toc] | [prev] | [next] | [standalone]


#15634 — Re: Controlling the Garbage Collector

FromLew <lewbloch@gmail.com>
Date2012-06-26 16:48 -0700
SubjectRe: Controlling the Garbage Collector
Message-ID<1c124f17-1b40-4164-a4a8-6b796805a0f5@googlegroups.com>
In reply to#15629
Andreas Leitgeb wrote:
> PS: is "youd've" any common? It was easy to understand, but I'd never
>   before seen it written that way.  Most of Google's first-page hits
>   seem to be discussions about how legal something like "you'd've"
>   would be. Only hit for "youd've" is in a youtube-video title.

No, I accidentally didn't type the first apostrophe. It was a simple typo.

-- 
Lew

[toc] | [prev] | [next] | [standalone]


#15497 — Re: Controlling the Garbage Collector

Frommarkspace <-@.>
Date2012-06-21 15:15 -0700
SubjectRe: Controlling the Garbage Collector
Message-ID<js06dj$bji$1@dont-email.me>
In reply to#15490
On 6/21/2012 11:24 AM, Aaron W. Hsu wrote:
> On the other side, there are times when I know that I am going to be
> doing a number of very small, little allocations all in a row, and I do
> not want the GC to run during this tight loop,


I believe this is what the Java GC does by default.  It allocates large 
blocks of memory from the OS and then creates new objects in that large 
block, quickly and efficiently.  The only time the GC should run here is 
if you literally run out of memory and must GC.


> Finally, there are times when I want to do a large bulk allocation
> outside of the collector, and then selectively move certain things into
> the collected space, but still have a checked, high-level way of
> accessing data structures in the uncollected space.


This sounds basically like System.gc().  System.gc() will run the GC, 
move objects into one or more permanent generation spaces, and then dump 
the large blocks of temporary objects.

Many things can alter this, and I see you have some special 
requirements, but the main bits of the Java GC should give you something 
very close to what you are looking for.

[toc] | [prev] | [next] | [standalone]


#15500 — Re: Controlling the Garbage Collector

FromLew <lewbloch@gmail.com>
Date2012-06-21 15:33 -0700
SubjectRe: Controlling the Garbage Collector
Message-ID<cb36f9a1-888c-490e-aa99-1e5ce0cc9354@googlegroups.com>
In reply to#15497
markspace wrote:
> System.gc() will

request to  
> run the GC, 

which request might not be honored, but if it is, it will

> move objects into one or more permanent generation spaces, and then dump 
> the large blocks of temporary objects.
> 
> Many things can alter this, and I see you have some special 
> requirements, but the main bits of the Java GC should give you something 
> very close to what you are looking for.

Agreed.

Tell us why the existing options don't reach your goals, OP.

-- 
Lew

[toc] | [prev] | [next] | [standalone]


#15502 — Re: Controlling the Garbage Collector

From"Aaron W. Hsu" <arcfide@sacrideo.us>
Date2012-06-21 21:24 -0500
SubjectRe: Controlling the Garbage Collector
Message-ID<6s2dnWJ_8r7OSn7SnZ2dnUVZ_s6dnZ2d@giganews.com>
In reply to#15500
On Thu, 21 Jun 2012 15:33:57 -0700, Lew wrote:

> Tell us why the existing options don't reach your goals, OP.

Thank you for the many responses so far. I should clarify that I am not 
worried too much that I will not be able to reach my goals in Java, but I 
was just hunting for ways in which I could gain better control over the 
system moving forward.  I have more pressing practical, higher-level 
concerns at the moment as relates to higher order programming and 
primitives that I will post about separately, but I do appreciate all the 
responses detailing how I might tackle issues of garbage collection if 
they come up.

-- 
Aaron W. Hsu | arcfide@sacrideo.us | http://www.sacrideo.us
Programming is just another word for the lost art of thinking.

[toc] | [prev] | [next] | [standalone]


#15498 — Re: Controlling the Garbage Collector

Frommarkspace <-@.>
Date2012-06-21 15:23 -0700
SubjectRe: Controlling the Garbage Collector
Message-ID<js06se$dea$1@dont-email.me>
In reply to#15490
You've probably seen this or something like it already, but here's a 
reference to Java's current GC implementation.  Note that "serial, 
stop-the-world" garbage collectors are kind of old fashioned these days.

<http://www.oracle.com/technetwork/java/javase/gc-tuning-6-140523.html>



[toc] | [prev] | [next] | [standalone]


#15360

FromWanja Gayk <brixomatic@yahoo.com>
Date2012-06-17 15:49 +0200
Message-ID<MPG.2a47fed7e9a27b6998970c@202.177.16.121>
In reply to#15320
In article <jrgo11$3t6$1@dont-email.me>, esosman@ieee-dot-org.invalid 
says...

>      Okay.  Keep in mind that in Java it is very difficult to avoid
> being preempted: Even if the thread you're interested in is careful
> not to create new object instances, object creation in other threads
> can trigger the garbage collector at pretty much any time.

So what? "Go ahead, make a mess", as Brian Goetz puts it.
http://www.ibm.com/developerworks/java/library/j-jtp09275/index.html

Usually the least problematic objects are the ones that are constructed 
quickly and die very young. As a copying collector only copies live 
objects the dead ones don't increase the collector's effort. 

It's rather the objects that survive the minor collections which cause 
the pain, or the ones that are expensive to construct (like the infamous 
"concatenate strings in a loop" example, which involves copying the char 
array).

If you're really, really excessively creating objects that die young, 
filling up the memory with dead objects, you may probably cause some 
short lived objects, that would normally not survive a few minor 
collections to promote to an older generation prematurely, since you've 
raised the frequency of the GCs and also cause more copying of live 
objects than necessary, but I have yet to encounter something like that 
causing a significant performance hit in a real world application, where 
IO and thread contention mask away such potential problems and minor 
garbage collection pauses. Even then I'd excpect that increasing the 
copying collector's memory space would solve most of these.

Kind regards,
Wanja

-- 
..Alesi's problem was that the back of the car was jumping up and down 
dangerously - and I can assure you from having been teammate to 
Jean Alesi and knowing what kind of cars that he can pull up with, 
when Jean Alesi says that a car is dangerous - it is. [Jonathan Palmer]

--- Posted via news://freenews.netfront.net/ - Complaints to news@netfront.net ---

[toc] | [prev] | [next] | [standalone]


#15327

FromRoedy Green <see_website@mindprod.com.invalid>
Date2012-06-16 01:00 -0700
Message-ID<d6fot75hnhofqhdpjplmmkpckqfcvv98ma@4ax.com>
In reply to#15317
On Fri, 15 Jun 2012 20:19:12 -0400, Eric Sosman
<esosman@ieee-dot-org.invalid> wrote, quoted or indirectly quoted
someone who said :

>     The "collegial" nature of cooperative threading offers a degree
>of calmness, and some freedom from worry about critical sections
>(if you're on a uniprocessor, you may be able to avoid taking an
>explicit lock to guard a critical section: 

that takes me back. I wrote code for a Univac 1616 military mini to
make it simulate an IBM front end communications processor. That is
exactly how it worked.
-- 
Roedy Green Canadian Mind Products
http://mindprod.com
Controlling complexity is the essence of computer programming.
~ Brian W. Kernighan 1942-01-01
.

[toc] | [prev] | [next] | [standalone]


#15328

FromRoedy Green <see_website@mindprod.com.invalid>
Date2012-06-16 01:04 -0700
Message-ID<ccfot71o6qp2eqbl87i09chsmt0ud6m7iu@4ax.com>
In reply to#15327
On Sat, 16 Jun 2012 01:00:10 -0700, Roedy Green
<see_website@mindprod.com.invalid> wrote, quoted or indirectly quoted
someone who said :

>
>that takes me back. I wrote code for a Univac 1616 military mini to
>make it simulate an IBM front end communications processor. That is
>exactly how it worked.

Circa 1990 I wrote a co-operative thread package for windows for C. It
was surprisingly simple.  On task switch I had to save the stack and
registers and restore another thread's stack and registers.  That was
basically all there was to it.
-- 
Roedy Green Canadian Mind Products
http://mindprod.com
Controlling complexity is the essence of computer programming.
~ Brian W. Kernighan 1942-01-01
.

[toc] | [prev] | [next] | [standalone]


#15321

FromWanja Gayk <brixomatic@yahoo.com>
Date2012-06-16 04:03 +0200
Message-ID<MPG.2a4607aaeeeec2e7989708@202.177.16.121>
In reply to#15311
In article <YvmdncQlVsKmJUbSnZ2dnUVZ_t4AAAAA@giganews.com>, 
arcfide@sacrideo.us says...
> 
> I am considering moving one of my projects from C to Java, but I am 
> hoping to find a high-performance threading implementation, or something 
> along the lines of libqthread, which offers Fill-Empty bit blocking and 
> good cooperative lightweight threading as a library.
> 
> Is there a current "best" solution when doing many threaded programs in 
> Java?  By many threads I mean many more than the cores or machines on the 
> network.  Something that scales up efficiently to distributed computing 
> would be nice as well.

For a local solution java.util.concurrent may be sufficient. 
If you want go go for distributed computing however, you might want to 
look at Gigaspaces/OpenSpaces which should scale very well, as it 
follows the rather simple tuple-spaces paradigm. 
Or you may use a clustering solution built from stateless session beans 
running on the JBoss application server. The latter will be probably the 
more common solution, but I think Gigaspaces looks much more elegant.

Both solutions for clustering do all the load balancing and network 
communication for you, plus they offer some persistence and transaction 
management.

> http://www.gigaspaces.com/wiki/display/XAP8/Writing+Your+First+XTP+App
lication <

Kind regards,
Wanja


-- 
..Alesi's problem was that the back of the car was jumping up and down 
dangerously - and I can assure you from having been teammate to 
Jean Alesi and knowing what kind of cars that he can pull up with, 
when Jean Alesi says that a car is dangerous - it is. [Jonathan Palmer]

--- Posted via news://freenews.netfront.net/ - Complaints to news@netfront.net ---

[toc] | [prev] | [next] | [standalone]


Page 4 of 5 — ← Prev page 1 2 3 [4] 5  Next page →

Back to top | Article view | comp.lang.java.programmer


csiph-web