<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Jason,<br>
<br>
<blockquote
 cite="mid:aa22f0200710191320n5b650148l893d41c93e542b62@mail.gmail.com"
 type="cite">
  <blockquote type="cite">
    <pre wrap=""> That may be the case from your - and others - perspective - and I have
empathy for it -, however they are still valid techniques and others, such
as myself, don't share your perspective.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Sure, just as manual memory management is still valid and needed at
the lowest levels of programming.  It's just not valid in most
applications.
  </pre>
</blockquote>
<br>
I've not yet seen any serious discussion of the case for your point of
view which bridges the gap of complexity in concurrency as automatic
memory management magically does. Please illuminate us with specific
and complete details of your proposal for such a breakthrough in
concurrency complexity.<br>
<br>
<br>
<blockquote
 cite="mid:aa22f0200710191320n5b650148l893d41c93e542b62@mail.gmail.com"
 type="cite">
  <pre wrap="">Making the Squeak VM fully multi-threaded (natively) is going to be a lot of pain and
hard to get right.  Just ask the Java VM team.
  </pre>
</blockquote>
<br>
Then either the hard work needs to be done, or the VM needs to be
completely rethought.<br>
<br>
<br>
<blockquote
 cite="mid:aa22f0200710191320n5b650148l893d41c93e542b62@mail.gmail.com"
 type="cite">
  <pre wrap="">The pay back of adding this obsolete (except in the lowest level
cases) method of dealing with threading just isn't going to be worth
the pain to implement it.
  </pre>
</blockquote>
<br>
What are you going on about? What techniques are you saying are
obsolete exactly? How are they obsolete? <br>
<br>
<br>
<blockquote
 cite="mid:aa22f0200710191320n5b650148l893d41c93e542b62@mail.gmail.com"
 type="cite">
  <blockquote type="cite">
    <pre wrap=""> The reality of processor designs like the Tile 64 require us to have all
available techniques at our disposal.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Why?
  </pre>
</blockquote>
<br>
Why? 64 processors on a single chip - with 128 coming next year and
1024 planned - that's why.<br>
<br>
With that many processors on a single core it's important that systems
and applications run smoothly taking advantage of all the opportunities
for parallelism. This has many implications, some of which work better
on one method of concurrency than on another. One size of shoe doesn't
fit all solutions.<br>
<br>
<br>
<blockquote
 cite="mid:aa22f0200710191320n5b650148l893d41c93e542b62@mail.gmail.com"
 type="cite">
  <blockquote type="cite">
    <pre wrap=""> Exactly my point. Thus the solutions proposed as being "simplier" are just
an illusion.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
?  They are unquestionably simpler to the programmer who is using them
(which is what I meant).
  </pre>
</blockquote>
<br>
You've missed the point. Even the simplest of concurrency methods
proposed so far by people in the Squeak thread lead to the most complex
concurrency control error scenarios. That's one of the points. Another
is that the simplest of concurrency models can't handle all the
scenarios.<br>
<br>
As asked above please describe in detail and completely the proposed
"simple" approach to concurrency that is being proposed. Links to
appropriate descriptions if it exist would also be fine (unless it
contains too much extraneous text).<br>
<br>
<br>
<blockquote
 cite="mid:aa22f0200710191320n5b650148l893d41c93e542b62@mail.gmail.com"
 type="cite">
  <blockquote type="cite">
    <pre wrap="">They might be simplier in some cases but when you really need
complex concurrency controls sometimes you need the other "dirtier"
techniques at your disposal.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
This is like saying that Smalltalk is wrong to not expose manual
memory management to you for when you need to get "down and dirty".
It's simply not the case.  You move to a higher level, just as we do
with all abstractions.
  </pre>
</blockquote>
<br>
Nonsense it's not like saying that at all.<br>
<br>
Sometimes moving to a higher level abstraction isn't the solution.
Sometimes moving laterally provides the insight for the solution. Often
moving down to the lowest levels and rethinking how they work provides
the solutions without higher levels of abstraction.<br>
<br>
A case in point for clarity: Exokernels. They remove higher levels of
abstraction so that we have access to the power of the real hardware.<br>
<br>
"The idea behind exokernels is to force as few abstractions as possible
on developers, enabling them to make as many decisions as possible
about hardware abstractions." - <a class="moz-txt-link-freetext" href="http://en.wikipedia.org/wiki/Exokernel">http://en.wikipedia.org/wiki/Exokernel</a>.<br>
<br>
The problem with concurrency is that it's much more complex by orders
of magnitude than garbage collection. Much more complex a beast, so
much more so that the comparison breaks down.<br>
<br>
Stephen Wolfram's work on Cellular Automata (page 27 of A New Kind of
Science <a class="moz-txt-link-freetext" href="http://www.wolframscience.com/nksonline/page-27">http://www.wolframscience.com/nksonline/page-27</a>) proves, yes,
proves that even (some) simple systems can generate results (i.e.
behaviour) that is as complex as any generated by a complex system. <br>
<br>
Wolfram states: "The picture [of a cellular automation rule 30] shows
what happens when one starts with just one black cell and then applies
this rule over and over again. And what one sees is something quite
startling - and probably the single most surprising scientific
discovery I have ever made. Rather than getting a simple regular
pattern as we might expect, the cellular automation instead produces a
pattern that seems extremely irregular and complex." Most of the rest
of his book is exploring just how complex this behavior really is.<br>
<br>
Often this feature of simple systems is just what we want to take
advantage of. Certainly Smalltalk leverages the power of this
simplicity with it's simple syntax. So if there is a way (or ways) to
have simple concurrency that is effective I'm all for it. <br>
<br>
However, there is a dark side to Stephen Wolfram's discovery as well
that needs addressing and that I'm attempting to point out here. The
dark side is that simple systems can generate complex results. Complex
results (beyond comprehension) is just want we don't want when we enter
the world of concurrency. The rub is that there isn't anyway to avoid
the complex results as far as I can see for simple systems can generate
complexity as complex as complex systems. <br>
<br>
I fear that the solutions space isn't as straightforward as having a
set of simplified concurrency primitives as proposed by some for
Smalltalk. The reality is harsher than you think. The solution space
requires more than a simple set of concurrency primitives.<br>
<br>
<br>
<blockquote
 cite="mid:aa22f0200710191320n5b650148l893d41c93e542b62@mail.gmail.com"
 type="cite">
  <blockquote type="cite">
    <pre wrap="">Smalltalk is supposed to be a computer language
with general power to control the computer and access it's true power and
potential. Limiting the solution space by only implementing a limited set of
concurrency primitives makes no sense. You'll just give the market to other
lesser systems like Erlang and Java type systems.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
This last sentence is quite odd, and to be frank not well reasoned at all.
  </pre>
</blockquote>
<br>
Thank you for calling it "odd". That's what happens when you think
different, at first people think it odd. I often encourage people to
think different as Apple does in their marketing of a few years ago.<br>
<br>
As for how it's reasoned, yes, it is well reasoned even if you don't
get it at first or even if I wasn't clear about it. Let me attempt to
clarify the reasoning for you.<br>
<br>
<blockquote
 cite="mid:aa22f0200710191320n5b650148l893d41c93e542b62@mail.gmail.com"
 type="cite">
  <pre wrap="">First of all Erlang is not lesser, it is in fact currently the leader
in this area.  </pre>
</blockquote>
<br>
How is that?<br>
<br>
<br>
<blockquote
 cite="mid:aa22f0200710191320n5b650148l893d41c93e542b62@mail.gmail.com"
 type="cite">
  <pre wrap="">It's funny though, that you suggest we would "give the
market over" to Erlang, since Erlang supports precisely *one* form of
concurrency:  share-nothing message passing.  </pre>
</blockquote>
<br>
Yes, but Erlang is a purely function non-object-oriented
non-keyword-message passing language.<br>
<br>
While it has a form of message passing it's not the same as
Smalltalk's. It's simply passing parameters to functions that run in
separate green or native threads. <br>
<br>
Yes it is impressive what they have accomplished, but it isn't the be
all and end all.<br>
<br>
<br>
<blockquote
 cite="mid:aa22f0200710191320n5b650148l893d41c93e542b62@mail.gmail.com"
 type="cite">
  <pre wrap="">Erlang can run in multiple threads, but only the interpreter does that, and it's
transparent to the processes running in the VM.
  </pre>
</blockquote>
<br>
Every system needs improvement.<br>
<br>
<blockquote
 cite="mid:aa22f0200710191320n5b650148l893d41c93e542b62@mail.gmail.com"
 type="cite">
  <pre wrap="">
Second of all, do you seriously think adding fine-grained threading to
Smalltalk automatically will cause it to take over the market?  </pre>
</blockquote>
<br>
No I don't think that it will "cause" Smalltalk to "automatically take
over the market". Of course not! Nor did I imply that or intend to
imply that. <br>
<br>
I simply think that having all the tools at our disposal is important
to maintaining and growing market share.<br>
<br>
<br>
<blockquote
 cite="mid:aa22f0200710191320n5b650148l893d41c93e542b62@mail.gmail.com"
 type="cite">
  <pre wrap="">Ironically, the fact of the matter is: the languages that make
threading *simpler to implementers* are going to be the ones who win
in the apparently coming multi-core world.    </pre>
</blockquote>
<br>
"Simpler to implement" concurrency leads to just as difficult to manage
software systems as more complex well thought out concurrency. In fact,
I think, that making it simplistic will lead many programmers to
implement software that is impossible to debug without enormous
efforts. The problem is that even the simplest concurrency leads to the
nastiest and most complex bugs in software.<br>
<br>
For example what could be simpler than Smalltalk's forking of blocks of
code? It sure seems simple doesn't it; just a simple message to a block
of code: "[ ... ] fork". In many cases it is simple and no harm is done
as the code will execute and everything will be good and consistent
afterwards. The problems begin when you "fork" code that wasn't
designed to be forked and run concurrently. Then all hell can break
loose and boom your program crashes unexpectedly with a mystery. It
gets even worse when it only happens occasionally - try figuring it out
then.<br>
<br>
I just working on fixing a "fork" happy approach in a major Smalltalk
production application. In the end we took out many of the forking
statements or fixed them in other ways. That application was running in
a Smalltalk with ONE native thread for all the Smalltalk processes (aka
green lightweight threads). So much for simple threading being easier.<br>
<br>
Part of the problem was the programmers being "fork" happy. Part of the
problem is that the Smalltalk class library isn't designed to be thread
safe. Very few class libraries are. Most of the problem is that the
concurrency simply wasn't thought out well. <br>
<br>
I don't see how you can have a simple concurrency threading model solve
the problems of when and how to use concurrency properly to avoid the
many pitfalls of threading. If you can see that please illuminate it
for the rest of us.<br>
<br>
<blockquote
 cite="mid:aa22f0200710191320n5b650148l893d41c93e542b62@mail.gmail.com"
 type="cite">
  <pre wrap="">Just ask Tim Sweeny.
  </pre>
</blockquote>
<br>
Do you mean Tim Sweeney the game developer?
<a class="moz-txt-link-freetext" href="http://en.wikipedia.org/wiki/Tim_Sweeney_(game_developer)">http://en.wikipedia.org/wiki/Tim_Sweeney_(game_developer)</a><br>
<br>
Alright even though I don't know Tim I'll take the bait and see where
it goes, Tim Sweeney (or Sweeny) what do you think? (If someone who
knows him would be kind enough to pass this thread on to him or post
his thoughts on this topic that would be great - thanks). <br>
<br>
<br>
<blockquote
 cite="mid:aa22f0200710191320n5b650148l893d41c93e542b62@mail.gmail.com"
 type="cite">
  <blockquote type="cite">
    <pre wrap=""> For example, when building hard core operating systems.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
If you want to build a hard core operating system in Smalltalk you
have other more pressing issues to deal with then how threading is
accomplished.  </pre>
</blockquote>
<br>
Yes, there are many issues in implementing an operating system in a
language such as Smalltalk. In exploring these issues ZokuScript was
born. Real native processes with protected memory spaces and multiple
threads are just one of these important issues. Performance is another.<br>
<br>
Threading including native threading on one core or N cores (where N
can be large) under existing operating systems is very important to the
future of Smalltalk.<br>
<br>
<br>
<blockquote
 cite="mid:aa22f0200710191320n5b650148l893d41c93e542b62@mail.gmail.com"
 type="cite">
  <pre wrap="">I really don't see what it is you think you lose not having this old,
out dated fine-grained threading model.
  </pre>
</blockquote>
<br>
For clarity purposes, please define in detail what you mean when you
use the phrase "fine-grained threading model" so that we can make sure
that we are on&nbsp; the same page.<br>
<br>
<br>
<br>
<blockquote
 cite="mid:aa22f0200710191320n5b650148l893d41c93e542b62@mail.gmail.com"
 type="cite">
  <blockquote type="cite">
    <pre wrap=""> There are many paths. I'm excited about the path that you are forging. All
I ask is that you don't make that the only path to travel for people using
Smalltalk.
    </pre>
  </blockquote>
  <pre wrap=""><!---->
Well, at the moment I'm forging nothing, only stating what I know of
the situation.  At some later point I do intend to look at what's
required to make this happen in Squeak, but I have some other more
pressing issues for the present.

  </pre>
  <blockquote type="cite">
    <pre wrap=""> While I support Smalltalk inventing the future, keeping it from supporting
valid concurrency techniques is ignoring the future (and the past) of what
works!
    </pre>
  </blockquote>
  <pre wrap=""><!---->
We have very different definitions for "works".  Here you are using it
the same way someone would use for &lt;insert crappy programming
language&gt;.  It works in the same way you can paint a house with a
tooth brush.
  </pre>
</blockquote>
<br>
You seem to think that there is some magical breakthrough in the world
of concurrency that is on par with the magic of automatic garbage
collection. I'd sure love to know what that is and how it avoids the
pitfalls with even simple concurrency models and issues that occur in
real world projects. If you could, please describe in full detail and
completely with real world examples. Thanks very much.<br>
<br>
All the best,<br>
<br>
Peter William Lount<br>
<a class="moz-txt-link-abbreviated" href="mailto:peter@smalltalk.org">peter@smalltalk.org</a><br>
Smalltalk.org Editor<br>
</body>
</html>