The Artima Developer Community
Sponsored Link

Articles Forum
The Next Big JVM Language

62 replies on 5 pages. Most recent reply: Sep 24, 2011 2:36 PM by samsulla samsulla

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 62 replies on 5 pages [ « | 1 2 3 4 5 | » ]
Achilleas Margaritis

Posts: 674
Nickname: achilleas
Registered: Feb, 2005

Re: A practical point I think will be important Posted: Sep 29, 2010 7:43 AM
Reply to this message Reply
Advertisement
> > I still wonder how this enthusiasm comports with
> Amdahl's
> > Law? Outside of servers, how many truly
> > parallel/concurrent problems are there in
> > client/standalone applications?
>
> Actually there are lots of parallel tasks in client or
> standalone applications.
>
> You need to keep your UI responsive, so that should have a
> dedicated thread.
> Longer running work items started from the UI should run
> in another thread.
> Network interaction/downloads should also be on a
> background threads, as should interaction with local
> storage (which might very well be networked itself).
>
> So even there you get a lot of benefit from immutability
> and other functional properties to avoid one task
> corrupting another tasks data.
>
> Communication between the thread might be realized through
> Software Transactional Memory, where updates may be run
> multiple times if a conflict occurs. That can only be done
> if your update functions are purely functional (no
> side-effects).
>
> I'm sure there are more benefits that could be listed.
>
> The problem here is that these things require a change in
> how developers think, and making that change is quite a
> bit harder than changing software itself.

Another way to do concurrency/parallelism is to use the Active Object pattern. This pattern also fits will with object-oriented designs.

robert young

Posts: 361
Nickname: funbunny
Registered: Sep, 2003

Re: A practical point I think will be important Posted: Sep 29, 2010 3:17 PM
Reply to this message Reply
> > I still wonder how this enthusiasm comports with
> Amdahl's
> > Law? Outside of servers, how many truly
> > parallel/concurrent problems are there in
> > client/standalone applications?
>
> Actually there are lots of parallel tasks in client or
> standalone applications.
>
> You need to keep your UI responsive, so that should have a
> dedicated thread.
> Longer running work items started from the UI should run
> in another thread.
> Network interaction/downloads should also be on a
> background threads, as should interaction with local
> storage (which might very well be networked itself).

In real life, I don't see that happening with applications. Asking for a download, OK, I'll buy that.

But having tasks which are run at the behest of the user, but which the user is indifferent to when the task is completed, not so much. That indifference is key. With servers, each thread is run to satisfy (approximately) a user request, independent of other users; so there's no violation of Amdahl. With a true client/standalone application, either the user is working linearly (it's been found that humans are not all that adept at multi-tasking) in which case s/he'll want to know the result of step A before going on to step B, or s/he's running something like a VB/Access application; printing a G/L report while posting AR. But that's just a server, albeit single user.

>
> So even there you get a lot of benefit from immutability
> and other functional properties to avoid one task
> corrupting another tasks data.
>
> Communication between the thread might be realized through
> Software Transactional Memory, where updates may be run
> multiple times if a conflict occurs. That can only be done
> if your update functions are purely functional (no
> side-effects).
>
> I'm sure there are more benefits that could be listed.
>
> The problem here is that these things require a change in
> how developers think, and making that change is quite a
> bit harder than changing software itself.

I argue that it's much more about how humans think. Again, we don't really multi-task efficiently. Expecting that we'll all of a sudden multi-task while interacting with applications smacks of Commander Data. Highly parallel/concurrent machines have existed in recent memory (well, for some of us), for not obscene amounts of money, and they failed simply because no one could figure out problems for them to solve. The web doesn't really change that, and the web is the only meaningful change to the world since those machines.

Still seems to me to be a solution in search of a problem. The simple way to provide an answer is to sketch how Word would be made better if it were written in an FP. Do that, and people will be convinced.

robert young

Posts: 361
Nickname: funbunny
Registered: Sep, 2003

Re: A practical point I think will be important Posted: Sep 29, 2010 3:46 PM
Reply to this message Reply
> The big interest in FP is to take advantage of multiple
> cores and processors.

Just to be clear; it's not an advantage. Stable or decreasing clocks (which hasn't quite happened yet, really) on a core are seen as a problem for existing client/standalone apps. They'll just run slower than they used to. The Gates-ian motto "write for the next generation of processor, it'll be fast enough" no longer worked (well, that's been the assumption). It's a lemon that has to be turned into lemonade.

Much the same as the birth of the Wintel monopoly: M$ and Intel have been symbiotic (or parasitic, depending on one's point of view), M$ creating ever more bloated software to suck up the cycles that Intel was putting into each new processor. Linux made this quite clear, by not playing that game.

So, Intel/AMD/ARM/etc. need to create a class of applications which can suck up all those concurrent cycles; the old way doesn't work. One way, for commercial type applications of course, is to reduce the client machine to a pixelated VT-100 (which is happy with a 6502), and put those fabulous multi-core/processor machines to work as database servers. But that won't move enough units. Hmmm.

What we'll likely end up with doing is ignore Amdahl, move to the FP of the month for a while until the java/FP emerges, slice up our inherently linear code (because it serves an inherently linear human brain: see the writings of Nick Carr, for example) into bits and pieces to fit the new hardware. The resulting applications won't be any better or faster, but shinier. At least to the coders, anyway.

Cedric Beust

Posts: 140
Nickname: cbeust
Registered: Feb, 2004

Re: A practical point I think will be important Posted: Sep 29, 2010 4:04 PM
Reply to this message Reply
> M$ creating ever more bloated software to suck up the cycles that Intel was putting into each new processor.

Do you seriously believe that Microsoft is intentionally bloating their software to force people to keep buying more powerful Intel chips?

--
Cédric

Mark Thornton

Posts: 275
Nickname: mthornton
Registered: Oct, 2005

Re: A practical point I think will be important Posted: Sep 29, 2010 4:04 PM
Reply to this message Reply
I don't seem to have many inherently linear tasks which are CPU bound and where the time taken on current processors is long enough to notice.
All the slow CPU bound tasks I have are capable of at least some use of concurrency. Some may not scale well beyond perhaps 4 cores, while others easily scale to hundreds.
The rest of my slow tasks are either disk or network bound.

Mark Thornton

Posts: 275
Nickname: mthornton
Registered: Oct, 2005

Re: A practical point I think will be important Posted: Sep 29, 2010 4:10 PM
Reply to this message Reply
> > M$ creating ever more bloated software to suck up the
> cycles that Intel was putting into each new processor.
>
> Do you seriously believe that Microsoft is intentionally
> bloating their software to force people to keep buying
> more powerful Intel chips?
>

They used to believe that most software was bought with new machines; software that would run on older hardware was more likely to be 'borrowed' rather than paid for. So designing for the net generation of hardware was an early, crude form of copy restriction. I heard this explained by a senior Microsoftee from the the platform at a public conference (mid '90s).

robert young

Posts: 361
Nickname: funbunny
Registered: Sep, 2003

Re: A practical point I think will be important Posted: Sep 29, 2010 8:58 PM
Reply to this message Reply
> > M$ creating ever more bloated software to suck up the
> cycles that Intel was putting into each new processor.
>
> Do you seriously believe that Microsoft is intentionally
> bloating their software to force people to keep buying
> more powerful Intel chips?
>
> --
> Cédric

Umm. Yes. And I was hardly the first one to see that.

Cedric Beust

Posts: 140
Nickname: cbeust
Registered: Feb, 2004

Re: A practical point I think will be important Posted: Sep 29, 2010 9:07 PM
Reply to this message Reply
> Umm. Yes. And I was hardly the first one to see that.

You mean you saw the source code and you found sleep loops there or you just like to believe conspiracy theories?

--
Cédric

Erik Engbrecht

Posts: 210
Nickname: eengbrec
Registered: Apr, 2006

Re: A practical point I think will be important Posted: Sep 29, 2010 9:33 PM
Reply to this message Reply
> > > M$ creating ever more bloated software to suck up the
> > cycles that Intel was putting into each new processor.
> >
> > Do you seriously believe that Microsoft is
> intentionally
> > bloating their software to force people to keep buying
> > more powerful Intel chips?
> >
> > --
> > Cédric
>
> Umm. Yes. And I was hardly the first one to see that.

Seems to me that if MS was trying to make it's products bloated, they would be a lot more bloated than they are. Bloating is one of those things you have to constantly fight and resist. It doesn't take effort.

Morgan Conrad

Posts: 307
Nickname: miata71
Registered: Mar, 2006

Responding to an earlier comment Posted: Sep 29, 2010 11:30 PM
Reply to this message Reply
"What I'm trying to say is that we should stick with C++, especially C++0x, and forget about the rest."

Interesting. I programmed a fair bit in C++ last century. Today I did my first serious coding in C++ in this century, writing a class, after years of Java.

Wow. Suddenly you have to worry about .h files, #IFDEF, #INCLUDE for the header files, declaring functions, in effect, in two different places (the header and the .cpp file). And if you mess up some closing semicolon or }, the preprocessor goes nuts and you get weird errors in some .h file (the next one) that you haven't even looked at. Not to mention whether to use foo.bar or foo->bar or where to put the * on a declaration.

The only thing I liked was the shortcut for ints

if (!error)

which is handy in chains of lots of function calls that return negative numbers on failures, e.g.

  int error = call_1();
  if (!error)
     error = call_2();
  ...
  if (!error)
     error = call_N();
 
  return error;


Of course, functions returning funny ints on errors are non-ideal, an exception is better, as well as some form of finally... :-(

Not to mention all the *real* faults of C++. Now, maybe C++0x fixes some of this, I don't know much about it.

Mark Thornton

Posts: 275
Nickname: mthornton
Registered: Oct, 2005

Re: A practical point I think will be important Posted: Sep 30, 2010 3:44 AM
Reply to this message Reply
> Seems to me that if MS was trying to make it's products
> bloated, they would be a lot more bloated than they are.
> Bloating is one of those things you have to constantly
> y fight and resist. It doesn't take effort.

Their view was that fighting bloat wasn't money well spent. So it wasn't a matter of adding bloat deliberately, merely not bothering to fight the natural bloat.

James Watson

Posts: 2024
Nickname: watson
Registered: Sep, 2005

Re: A practical point I think will be important Posted: Sep 30, 2010 12:55 PM
Reply to this message Reply
> Their view was that fighting bloat wasn't money well
> spent. So it wasn't a matter of adding bloat deliberately,
> merely not bothering to fight the natural bloat.

My understanding is that this changed for Windows 7. After Vista, they realized they couldn't continue that way forever.

robert young

Posts: 361
Nickname: funbunny
Registered: Sep, 2003

Re: A practical point I think will be important Posted: Sep 30, 2010 2:19 PM
Reply to this message Reply
http://www.google.com/url?sa=t&source=web&cd=15&ved=0CB0QFjAEOAo&url=http%3A%2F%2Fpublic.kenan-flagler.unc.edu%2Fcourses%2Fmba%2Fmba260e%2FFontenot_and_Hyman.pdf&rct=j&q=evidence%20wintel%20monopoly&ei=tNOkTP27HIL48Abb6cz4CQ&usg=AFQjCNFXKltDhe1Cq9x7nbl2BhXaKM2Pcg&cad=rja

search for wintel, or just go to page 1213. there are a host of references from there.

robert young

Posts: 361
Nickname: funbunny
Registered: Sep, 2003

Re: A practical point I think will be important Posted: Sep 30, 2010 2:20 PM
Reply to this message Reply
> > Seems to me that if MS was trying to make it's products
> > bloated, they would be a lot more bloated than they
> are.
> > Bloating is one of those things you have to constantly
> > y fight and resist. It doesn't take effort.
>
> Their view was that fighting bloat wasn't money well
> spent. So it wasn't a matter of adding bloat deliberately,
> merely not bothering to fight the natural bloat.

I'll grant the distinction, but maintain, from the Wintel point of view, it makes no difference.

Morgan Conrad

Posts: 307
Nickname: miata71
Registered: Mar, 2006

Re: A practical point I think will be important Posted: Sep 30, 2010 11:11 PM
Reply to this message Reply
Robert- maybe I missed it in my perusal, but the article you cite has zero information about MS deliberately bloating their SW to help Intel.

Please support your claim.

Flat View: This topic has 62 replies on 5 pages [ « | 1  2  3  4  5 | » ]
Topic: Scala's Stackable Trait Pattern Previous Topic   Next Topic Topic: Becoming an Architect


Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2014 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us