2008/7/7 Klaus D. Witzel <[hidden email]>:
> [sorry for cutting multiple Re's from the subject line] > > On Mon, 07 Jul 2008 13:11:05 +0200, Igor Stasenko wrote: > >> 2008/7/7 Klaus D. Witzel: >>> >>> On Mon, 07 Jul 2008 10:49:06 +0200, Igor Stasenko wrote: >>> >>>> 2008/7/7 Andreas Raab : >>>>> >>>>> Peter William Lount wrote: >>>>>> >>>>>> Why prevent others from having their needed multiple native threads? >>>>>> >>>>> >>>>> It's not about preventing anything. If you have a proposal for how to >>>>> do >>>>> multiple threads per image I will most definitely listen, and if it is >>>>> a >>>>> reasonable proposal (i.e., one that can be implemented with bounded >>>>> resources) I will even try to find funding for it. However, until such >>>>> a >>>>> time that there is a proposal I will drop this pointless discussion >>>>> since, >>>>> simply put, there is nothing to discuss here. The only available path >>>>> at >>>>> this point is by using one native thread per image and consequently >>>>> that's >>>>> what's going to happen. >>>>> >>>> >>>> I have some ideas of using Island/Vat model in future CorruptVM project. >>>> >>>> I'm not going into deep detail right now, but the essence of model is >>>> following: >>>> >>>> - an Island is the group of objects sharing same memory region. >>> >>> s/memory region/owner/ where owner can be sort of "deputy" of memory/VM >>> monitor. A very interesting concept indeed, thanks for posting :) >>> >>> I think that can be addressed with a small trick in Squeak's VM and *no* >>> extra object header (using one of the Metaclass ideas that Alex+my >>> discussed in Bern for Goya => coloring of metaclass instances). >>> >> >> Yes, there is no need in having extra state which indicates to which >> island belongs object. >> It is impossible by design to get direct reference to any object which >> not belongs to same island. > > I think that, "ref to any object" can be restricted to "any receiver", just > so when sending something. When not sending something (=> when just peeking > and poking oops) then belonging to some island is of not so much importance > (this "receiver detail" is why I suggested s/memory region/owner/). > > You agree? Of course the "any receiver" detail is relative to SqueakVM; > CorruptVM's mileage may vary. > object, wrapped by FarRef. >> For referencing objects from different island there will be a FarRef, >> which will be responsible for handling message sends to object in >> different island. > > Hah :) a natural extension of the #doesNotUnderstand: concept (with > FarMessageSend a subclass of MessageSend :) > Nah! You don't need to use DNU pattern, since you free to change a message sending semantics for FarRef. In this way, FarRef will act as transparent proxy, and ALL messages to it will lead to sending message to wrapped object which is located in different island. A FarRef could reserve a special selector for itself, like #performLocal: selector withArguments: args to send message to a FarRef object, not to wrapped object. >> > > > -- Best regards, Igor Stasenko AKA sig. |
Hello,
On Mon, Jul 7, 2008 at 2:38 PM, Igor Stasenko <[hidden email]> wrote: 2008/7/7 Klaus D. Witzel <[hidden email]>: The detailed documentation for current FarRef and Island's implementation could be found in the Croquet image (look in Island class comments). Thanks Andreas Raab for that. Regards, Nikolay
|
In reply to this post by pwl
On Mon, Jul 7, 2008 at 8:04 AM, Peter William Lount <[hidden email]> wrote:
> Jason Johnson wrote: > > Hi, > > Let's drop the flawed analogy with manual memory management shall we. It > doesn't map very well at all as an example. No of course not. It's quite a good analogy and just because *you* don't see it is no reason to drop it. As far as being "flawed", an analogy is a *similarity* not an exact description. > > Unless you're claiming some advancement in process concurrency that is > similar to garbage collection. I made this analogy myself in [1] and various [2] others [3]. The main point of the analogy, as mentioned in [1] is that garbage collection allowed a level of software composability that just isn't possible with manual memory management, and this is exactly the same situation with fine-grained locking. > So you're going after an Erlang model? Is that it? That would certainly be a good evolutionary step. It may be that the futures/promises model used by E/Croquet/etc. is the best we currently have. And in either case there is no sharing between executing entities. > I've seen no cleaner solution presented by any of you. How is it cleaner? Be > specific please. Implementation papers are all over the web for all the above technologies and more. Here are just a few links I saw while looking for [3]: http://research.microsoft.com/~simonpj/papers/stm/#beautiful (Simon-Peton-Jones, Beautiful concurrency) http://research.microsoft.com/~simonpj/papers/stm/#composable (SPJ and others, Composable memory transactions) http://www.drjava.de/e-presentation/html-english/img0.html (Stefan Reich, Escape from multithread hell) http://Erights.org (various regarding the E language and the futures technology) http://armstrongonsoftware.blogspot.com/2006/09/why-i-dont-like-shared-memory.html (Joe Armstrong - explanations why shared memory is bad. His blog contains various examples of how things are done in Erlang in the Actor model) http://www.eros-os.org/pipermail/e-lang/2001-July/005410.html ("Now, I agree with MarcS -- I believe that multithreading will go down in history next to manual memory management as one of the biggest sources of bugs ever, and as one of the biggest preventable wastes of programmer time and customer money ever.") > > All the best, > > Peter William Lount > [ | peter at smalltalk dot org ] value. > > > > [1] http://lists.squeakfoundation.org/pipermail/squeak-dev/2007-February/114181.html (NOTE: futures/promises are missing from my description) [2] http://www.cs.washington.edu/homes/djg/papers/analogy_oopsla07.pdf (The Transactional Memory / Garbage Collection Analogy - Dan Grossman) [3] There is a paper somewhere that is literally titled something like "similarities between shared state threading and manual memory management". My google-fu has utterly failed me for finding it, but I remember very clearly that it had a name like this because I tried to find out if it dated before my email [1] or not. |
In reply to this post by pwl
Hi Peter,
I'd be curious to hear your analysis of the GemStone/S approach where you can have as many OS processes as you want (well, up to 10,000), and they all share the same object space (image), but synchronize only on programmer-defined transaction boundaries. I believe that one large installation has a 256 CPU machine on which they run a couple thousand concurrent OS processes. The GS/S architecture has been in commercial development/deployment for a couple decades. James On Jul 6, 2008, at 8:45 PM, Peter William Lount wrote: > [snip] > > I do really like the N (small, medium, large) images in memory at > the same time model as it's excellent for things like web > application serving and many other applications. > > However, fixing the number of native threads to one per image simply > limits solutions by forcing a developer/user to split their program > across multiple images just so they can run multiple native threads > to take advantage of their hardware. I think it not a good thing to > impose that upon developers or users, in part because it will often > impose a solution refactoring and in part because it only works for > a subset of problems that can be easily partitioned across images. A > refactoring might be worthwhile but may be cost prohibitive. Also > moving all the objects around between images (in one memory space or > across memory spaces) involves other problems just as complex as any > multi-threading issues solved. So all you've done it punt the ball > aways down the field but it's still there... lurking... ready to > strike... > > [snip] > > If the Smalltalk/Squeak/Commercial community doesn't want to move > forward to take maximal general purpose advantage of the multi-core > cpus that would be a big disappointment indeed. The other languages > will leave Smalltalk in their dust. That is what clients are telling > me and I happen to agree with them. > > I ask the Squeak Smalltalk (and Commerical Smalltalk) virtual > machine developers and communities to please reconsider the general > purpose many native threads per image solution for the next versions > of your virtual machines. > > I think it's best to let each developer-user choose how many native > threads per image and how many images are loaded and which images > are loaded. After all it's their program. Isn't our job as language > and systems designers to provide them with the tools that they need > to build the systems that they want to build? I think so. What do > you think? > > All the best, > > Peter William Lount > [ | peter at smalltalk dot org ] > |
In reply to this post by pwl
On Mon, Jul 7, 2008 at 8:46 AM, Peter William Lount <[hidden email]> wrote:
> Hi, > > Ah, ok. Then you are aiming for the elimination of much of the existing > Smalltalk process/thread semantics. That's what I am afraid of. Well, read some of the huge body of literature about why this is a better way to go. The source of fear is often ignorance. > Jason Johnson: Here you just seem to be going off on a tangent without even > knowing > what solution he had in mind. Wonderfully productive way to argue. > > No need to get snarky Jason. It is a fine way to get across my points. You > obviously read something into it that wasn't intended. If you don't like my > writing style don't answer the posts, but there isn't any need to criticize > me for it Sir Jason. It is just frustrating when you always (though, granted, I've only seen you do it once in this thread) complain about how others disagree with you, and in this case completely build up something that no on actually said and then point out how ridiculous it is. We either have discussions in good faith or we don't. > Heck if you have a simple process concurrency model that you'll be sending > our way then it should be easy to describe it fully and in detail, don't you > think? Indeed. That's why there is such a body of information about better concurrency models on the web. And that's why I asked why Andreas would need to explain this yet again. > You're planning on fundamental changes to smalltalk/squeak and I think it's > very reasonable for a squeak user to ask what those changes are going to be > and how they will work and how they will impact existing Smalltalk programs > that make use of concurrency. Isn't that fair? It might be if that was actually what I was planning. Obviously I would be creating my own fork or entirely new implementation. Some of the ideas I have (not related to concurrency) would first be prototyped in Squeak and made available to everyone (but don't wait for it. Unless I win a lottery or two, I'm years away from doing much with this). |
In reply to this post by Igor Stasenko
On Mon, 07 Jul 2008 14:38:21 +0200, Igor Stasenko wrote:
> 2008/7/7 Klaus D. Witzel: >> [sorry for cutting multiple Re's from the subject line] >> >> On Mon, 07 Jul 2008 13:11:05 +0200, Igor Stasenko wrote: [...] >>>>> I have some ideas of using Island/Vat model in future CorruptVM >>>>> project. >>>>> >>>>> I'm not going into deep detail right now, but the essence of model is >>>>> following: >>>>> >>>>> - an Island is the group of objects sharing same memory region. >>>> >>>> s/memory region/owner/ where owner can be sort of "deputy" of >>>> memory/VM >>>> monitor. A very interesting concept indeed, thanks for posting :) >>>> >>>> I think that can be addressed with a small trick in Squeak's VM and >>>> *no* >>>> extra object header (using one of the Metaclass ideas that Alex+my >>>> discussed in Bern for Goya => coloring of metaclass instances). >>>> >>> >>> Yes, there is no need in having extra state which indicates to which >>> island belongs object. >>> It is impossible by design to get direct reference to any object which >>> not belongs to same island. >> >> I think that, "ref to any object" can be restricted to "any receiver", >> just >> so when sending something. When not sending something (=> when just >> peeking >> and poking oops) then belonging to some island is of not so much >> importance >> (this "receiver detail" is why I suggested s/memory region/owner/). >> >> You agree? Of course the "any receiver" detail is relative to SqueakVM; >> CorruptVM's mileage may vary. >> > of course, a difference lies only in a way how we sending message to > object, wrapped by FarRef. I think that the main difference we have here is induced by your "it is impossible by design to get direct reference to any object which not belongs to same island." which I take literally (without objection, to be clear). As a consequence, when running "in island #1" you cannot do proxy := anIsland2Object asFarRef. instead you must do proxy := FarRef with: anIsland2Object. and moreover [on a sideline, not so important] one cannot ask to which island *any* far (but as-yet-not-wrapped) object belongs. Therefore I thought that sending something to a far (but as-yet-not-wrapped) object is like a DNU which the VM detects and automatically wraps into a FarMessageSend. I think this is quite a difference to systems which would be based on manually wrapping (developer-driven-wrapping DDW), in which the impossibly to obtain a direct reference would be left to the developer (and/or her/his bugs). >>> For referencing objects from different island there will be a FarRef, >>> which will be responsible for handling message sends to object in >>> different island. >> >> Hah :) a natural extension of the #doesNotUnderstand: concept (with >> FarMessageSend a subclass of MessageSend :) >> > Nah! > You don't need to use DNU pattern, See above, not having sort of DNU can easily contradict your "it is impossible by design to get direct reference to any object which not belongs to same island". Somehow every *failure* to *not* get a direct reference must be detected and acted upon (note the negations). --------------- If you like we can go into more detail in email (also addressing #new instances and their belonging to an owner). > since you free to change a message > sending semantics for FarRef. > In this way, FarRef will act as transparent proxy, and ALL messages to > it will lead to sending message to wrapped object which is located in > different island. > > A FarRef could reserve a special selector for itself, like > #performLocal: selector withArguments: args > to send message to a FarRef object, not to wrapped object. > |
On Jul 7, 2008, at 7:07 AM, Klaus D. Witzel wrote: > On Mon, 07 Jul 2008 14:38:21 +0200, Igor Stasenko wrote: > >> 2008/7/7 Klaus D. Witzel: >>> [sorry for cutting multiple Re's from the subject line] >>> >>> On Mon, 07 Jul 2008 13:11:05 +0200, Igor Stasenko wrote: > [...] >>>>>> I have some ideas of using Island/Vat model in future CorruptVM >>>>>> project. >>>>>> >>>>>> I'm not going into deep detail right now, but the essence of >>>>>> model is >>>>>> following: >>>>>> >>>>>> - an Island is the group of objects sharing same memory region. >>>>> >>>>> s/memory region/owner/ where owner can be sort of "deputy" of >>>>> memory/VM >>>>> monitor. A very interesting concept indeed, thanks for posting :) >>>>> >>>>> I think that can be addressed with a small trick in Squeak's VM >>>>> and *no* >>>>> extra object header (using one of the Metaclass ideas that Alex+my >>>>> discussed in Bern for Goya => coloring of metaclass instances). >>>>> >>>> >>>> Yes, there is no need in having extra state which indicates to >>>> which >>>> island belongs object. >>>> It is impossible by design to get direct reference to any object >>>> which >>>> not belongs to same island. >>> >>> I think that, "ref to any object" can be restricted to "any >>> receiver", just >>> so when sending something. When not sending something (=> when >>> just peeking >>> and poking oops) then belonging to some island is of not so much >>> importance >>> (this "receiver detail" is why I suggested s/memory region/owner/). >>> >>> You agree? Of course the "any receiver" detail is relative to >>> SqueakVM; >>> CorruptVM's mileage may vary. >>> >> of course, a difference lies only in a way how we sending message to >> object, wrapped by FarRef. > > I think that the main difference we have here is induced by your "it > is impossible by design to get direct reference to any object which > not belongs to same island." which I take literally (without > objection, to be clear). As a consequence, when running "in island > #1" you cannot do > > proxy := anIsland2Object asFarRef. Of course not... you can't have a direct-ref to anIsland2Object in the first place. > instead you must do > > proxy := FarRef with: anIsland2Object. > Nope, can't do that either (for the same reason). To create an island in the first place, you evaluate anIsland := Island new. This doesn't give you a direct-ref to the island; it gives you a far- ref to it. You can instantiate a new object on the island by sending #new: to the island. aMorph := anIsland new: Morph. Of course, this gives you a far-ref to the newly created morph. If you send messages to this object, the answered object is also wrapped (for most objects anyway; some types of objects are copied). subMorph := anIsland new: EllipseMorph. aMorph addMorph: subMorph. subMorph owner. "a FarRef to aMorph" aMorph submorphs. "an Array of FarRefs to Morphs" aMorph position. "a Point (a copy of the on-island Point)" > and moreover [on a sideline, not so important] one cannot ask to > which island *any* far (but as-yet-not-wrapped) object belongs. > Every process is associated with an island, so any unwrapped object is associated with the island of the currently running process. > Therefore I thought that sending something to a far (but as-yet-not- > wrapped) object is like a DNU which the VM detects and automatically > wraps into a FarMessageSend. In terms of Tweak and Croquet, Tweak FarRefs do work by using DNU. Croquet TFarRefs require an explicit #future message to be sent to a far-ref. For example, the above would look something like (neglecting how to connect to a Croquet router): anIsland := TIsland new. aMorph := anIsland future new: Morph. subMorph := anIsland future new: EllipseMorph. aMorph future addMorph: subMorph. subMorph future owner. "a FarRef to aMorph" aMorph future submorphs. "an Array of FarRefs to Morphs" aMorph future position. "a Point (a copy of the on- island Point)" The original implementation had #future return a proxy object. In the current implementation, #future is a keyword that is handled specially by the Compiler. It's a bit more verbose, but on the other hand, all #future messages to a TFarRef result in network traffic, so being explicit makes it easier to keep track of what is going over the wire. > I think this is quite a difference to systems which would be based > on manually wrapping (developer-driven-wrapping DDW), in which the > impossibly to obtain a direct reference would be left to the > developer (and/or her/his bugs). Yes, definitely. If it is easy to cheat, then developers will cheat. >>>> For referencing objects from different island there will be a >>>> FarRef, >>>> which will be responsible for handling message sends to object in >>>> different island. >>> >>> Hah :) a natural extension of the #doesNotUnderstand: concept (with >>> FarMessageSend a subclass of MessageSend :) >>> >> Nah! >> You don't need to use DNU pattern, > > See above, not having sort of DNU can easily contradict your "it is > impossible by design to get direct reference to any object which not > belongs to same island". Somehow every *failure* to *not* get a > direct reference must be detected and acted upon (note the negations). > As described above, DNU is one way (but not the only way) to do this. Cheers, Josh > --------------- > > If you like we can go into more detail in email (also addressing > #new instances and their belonging to an owner). > >> since you free to change a message >> sending semantics for FarRef. >> In this way, FarRef will act as transparent proxy, and ALL messages >> to >> it will lead to sending message to wrapped object which is located in >> different island. >> >> A FarRef could reserve a special selector for itself, like >> #performLocal: selector withArguments: args >> to send message to a FarRef object, not to wrapped object. >> > > |
Hi Josh,
thank you very much for your kind message and the insightful comments! This line of your post I admire most: > > Yes, definitely. If it is easy to cheat, then developers will cheat. > As emailed to Igor a minute ago, he+me managed to mix up CorruptVM with SqueakVM in this thread and, from a comment that I've seen in another response, the concept of Island. Take my apologies and, thanks again. If something comes out from the email discussion that I suggested to Igor then I'll summarize and post. /Klaus On Mon, 07 Jul 2008 19:32:59 +0200, Joshua Gargus wrote: > On Jul 7, 2008, at 7:07 AM, Klaus D. Witzel wrote: > >> On Mon, 07 Jul 2008 14:38:21 +0200, Igor Stasenko wrote: >> >>> 2008/7/7 Klaus D. Witzel: >>>> [sorry for cutting multiple Re's from the subject line] >>>> >>>> On Mon, 07 Jul 2008 13:11:05 +0200, Igor Stasenko wrote: >> [...] >>>>>>> I have some ideas of using Island/Vat model in future CorruptVM >>>>>>> project. >>>>>>> >>>>>>> I'm not going into deep detail right now, but the essence of model >>>>>>> is >>>>>>> following: >>>>>>> >>>>>>> - an Island is the group of objects sharing same memory region. >>>>>> >>>>>> s/memory region/owner/ where owner can be sort of "deputy" of >>>>>> memory/VM >>>>>> monitor. A very interesting concept indeed, thanks for posting :) >>>>>> >>>>>> I think that can be addressed with a small trick in Squeak's VM and >>>>>> *no* >>>>>> extra object header (using one of the Metaclass ideas that Alex+my >>>>>> discussed in Bern for Goya => coloring of metaclass instances). >>>>>> >>>>> >>>>> Yes, there is no need in having extra state which indicates to which >>>>> island belongs object. >>>>> It is impossible by design to get direct reference to any object >>>>> which >>>>> not belongs to same island. >>>> >>>> I think that, "ref to any object" can be restricted to "any >>>> receiver", just >>>> so when sending something. When not sending something (=> when just >>>> peeking >>>> and poking oops) then belonging to some island is of not so much >>>> importance >>>> (this "receiver detail" is why I suggested s/memory region/owner/). >>>> >>>> You agree? Of course the "any receiver" detail is relative to >>>> SqueakVM; >>>> CorruptVM's mileage may vary. >>>> >>> of course, a difference lies only in a way how we sending message to >>> object, wrapped by FarRef. >> >> I think that the main difference we have here is induced by your "it is >> impossible by design to get direct reference to any object which not >> belongs to same island." which I take literally (without objection, to >> be clear). As a consequence, when running "in island #1" you cannot do >> >> proxy := anIsland2Object asFarRef. > > Of course not... you can't have a direct-ref to anIsland2Object in the > first place. > >> instead you must do >> >> proxy := FarRef with: anIsland2Object. >> > > Nope, can't do that either (for the same reason). > > To create an island in the first place, you evaluate > > anIsland := Island new. > > This doesn't give you a direct-ref to the island; it gives you a far-ref > to it. > > You can instantiate a new object on the island by sending #new: to the > island. > > aMorph := anIsland new: Morph. > > Of course, this gives you a far-ref to the newly created morph. If you > send messages to this object, the answered object is also wrapped (for > most objects anyway; some types of objects are copied). > > subMorph := anIsland new: EllipseMorph. > aMorph addMorph: subMorph. > subMorph owner. "a FarRef to aMorph" > aMorph submorphs. "an Array of FarRefs to Morphs" > aMorph position. "a Point (a copy of the on-island > Point)" > > >> and moreover [on a sideline, not so important] one cannot ask to which >> island *any* far (but as-yet-not-wrapped) object belongs. >> > > Every process is associated with an island, so any unwrapped object is > associated with the island of the currently running process. > >> Therefore I thought that sending something to a far (but as-yet-not- >> wrapped) object is like a DNU which the VM detects and automatically >> wraps into a FarMessageSend. > > In terms of Tweak and Croquet, Tweak FarRefs do work by using DNU. > Croquet TFarRefs require an explicit #future message to be sent to a > far-ref. For example, the above would look something like (neglecting > how to connect to a Croquet router): > > anIsland := TIsland new. > aMorph := anIsland future new: Morph. > subMorph := anIsland future new: EllipseMorph. > aMorph future addMorph: subMorph. > subMorph future owner. "a FarRef to aMorph" > aMorph future submorphs. "an Array of FarRefs to Morphs" > aMorph future position. "a Point (a copy of the on- > island Point)" > > The original implementation had #future return a proxy object. In the > current implementation, #future is a keyword that is handled specially > by the Compiler. It's a bit more verbose, but on the other hand, all > #future messages to a TFarRef result in network traffic, so being > explicit makes it easier to keep track of what is going over the wire. > >> I think this is quite a difference to systems which would be based on >> manually wrapping (developer-driven-wrapping DDW), in which the >> impossibly to obtain a direct reference would be left to the developer >> (and/or her/his bugs). > > Yes, definitely. If it is easy to cheat, then developers will cheat. > >>>>> For referencing objects from different island there will be a FarRef, >>>>> which will be responsible for handling message sends to object in >>>>> different island. >>>> >>>> Hah :) a natural extension of the #doesNotUnderstand: concept (with >>>> FarMessageSend a subclass of MessageSend :) >>>> >>> Nah! >>> You don't need to use DNU pattern, >> >> See above, not having sort of DNU can easily contradict your "it is >> impossible by design to get direct reference to any object which not >> belongs to same island". Somehow every *failure* to *not* get a direct >> reference must be detected and acted upon (note the negations). >> > > As described above, DNU is one way (but not the only way) to do this. > > Cheers, > Josh > > >> --------------- >> >> If you like we can go into more detail in email (also addressing #new >> instances and their belonging to an owner). >> >>> since you free to change a message >>> sending semantics for FarRef. >>> In this way, FarRef will act as transparent proxy, and ALL messages to >>> it will lead to sending message to wrapped object which is located in >>> different island. >>> >>> A FarRef could reserve a special selector for itself, like >>> #performLocal: selector withArguments: args >>> to send message to a FarRef object, not to wrapped object. >>> >> >> > > > |
In reply to this post by pwl
It seems that there is a general assumption that threads will remain the unit of computational parallelism. After attending Apple's WWDC and seeing some of the stuff in Snow Leopard, I don't believe this assumption is correct.
Simply saying smalltalk threads must map to system threads is short sighted I think. There are new models in the pipe that bear looking at. "Snow Leopard delivers unrivaled support for multi-core processors with a new technology code-named “Grand Central,” making it easy for developers to create programs that take full advantage of the power of multi-core Macs. Snow Leopard further extends support for modern hardware with Open Computing Language (OpenCL), which lets any application tap into the vast gigaflops of GPU computing power previously available only to graphics applications. OpenCL is based on the C programming language and has been proposed as an open standard." Apple press release. The unit of computation is not pthreads. There is recognition that threads only get you so far and it is looking like it isn't far enough. I think there's a major game change afoot and it is too early to make bets. On Jul 6, 2008, at 8:45 PM, Peter William Lount wrote: If the Smalltalk/Squeak/Commercial community doesn't want to move forward to take maximal general purpose advantage of the multi-core cpus that would be a big disappointment indeed. The other languages will leave Smalltalk in their dust. That is what clients are telling me and I happen to agree with them. |
2008/7/7 Todd Blanchard <[hidden email]>:
> It seems that there is a general assumption that threads will remain the > unit of computational parallelism. After attending Apple's WWDC and seeing > some of the stuff in Snow Leopard, I don't believe this assumption is > correct. > Simply saying smalltalk threads must map to system threads is short sighted > I think. There are new models in the pipe that bear looking at. > "Snow Leopard delivers unrivaled support for multi-core processors with a > new technology code-named "Grand Central," making it easy for developers to > create programs that take full advantage of the power of multi-core Macs. > Snow Leopard further extends support for modern hardware with Open Computing > Language (OpenCL), which lets any application tap into the vast gigaflops of > GPU computing power previously available only to graphics applications. > OpenCL is based on the C programming language and has been proposed as an > open standard." > Apple press release. The unit of computation is not pthreads. There is > recognition that threads only get you so far and it is looking like it isn't > far enough. Its just a press release :) We may call it thread or fiber or string, no matter what, but at base we having a sequence of operations which should be performed in an order, defined by programmer (which also known as algorithm). Its about human's nature and perception: we separate the concept of time onto three categories: past, present and future. So, i think the concept of 'threads' will likely to stay until last human lives on planet :) > I think there's a major game change afoot and it is too early to make bets. > On Jul 6, 2008, at 8:45 PM, Peter William Lount wrote: > > If the Smalltalk/Squeak/Commercial community doesn't want to move forward to > take maximal general purpose advantage of the multi-core cpus that would be > a big disappointment indeed. The other languages will leave Smalltalk in > their dust. That is what clients are telling me and I happen to agree with > them. > > I ask the Squeak Smalltalk (and Commerical Smalltalk) virtual machine > developers and communities to please reconsider the general purpose many > native threads per image solution for the next versions of your virtual > machines. > > I think it's best to let each developer-user choose how many native threads > per image and how many images are loaded and which images are loaded. After > all it's their program. Isn't our job as language and systems designers to > provide them with the tools that they need to build the systems that they > want to build? I think so. What do you think? > > > > > -- Best regards, Igor Stasenko AKA sig. |
I said 'pthreads', not threads. :-)
There was more at the briefing, but I'm under NDA. I like your islands idea, I've had the same kind of thing kicking around in the back of my head for some time but I have no time/money to work on it. It seems like the right direction though. On Jul 7, 2008, at 1:43 PM, Igor Stasenko wrote: > Its just a press release :) > > We may call it thread or fiber or string, no matter what, but at base > we having a sequence of operations which should be performed in an > order, defined by programmer (which also known as algorithm). > Its about human's nature and perception: we separate the concept of > time onto three categories: past, present and future. > So, i think the concept of 'threads' will likely to stay until last > human lives on planet :) |
2008/7/7 Todd Blanchard <[hidden email]>:
> I said 'pthreads', not threads. :-) > > There was more at the briefing, but I'm under NDA. > I like your islands idea, I've had the same kind of thing kicking around in > the back of my head for some time but I have no time/money to work on it. > It seems like the right direction though. > > It is good to see that they finally trying to use GPUs as generic purpose processing units. But it has own limitations, like inability to run different code in its 2^n working units. So it is more press release than real breakthrough :) -- Best regards, Igor Stasenko AKA sig. |
In reply to this post by Andreas.Raab
On Mon, Jul 7, 2008 at 8:08 PM, Andreas Raab <[hidden email]> wrote:
If I were working on a concurrent VM, I'd just barge ahead and parallelise the Squeak VM: * I'd refactor the VM so that multiple copies of the interpreter state could be held in the heap. I'd design it so that each pthread would run one instance of the standard Squeak interpreter, and so that each interpreter runs multiple green theads as it does now. This makes forking a very cheap operation and allows for having as many green threads as would fit in memory. * I'd then see what needs fixing in the VM / plug-ins / image to make it work. I'd probably start with the simple approach: an evil but simple global VM lock for memory writing operations, and no changes to GC. Later, we can revisit this to make it scale better. * I'd then spend the next decade finding and fixing concurrency bugs. What I'm actually going to do is: * Modify the Squeak schedular to simulate concurrency better and bring up lots of concurrency bugs in the image. * Spend a decade fixing concurrency bugs in the image. * Write enough concurrent code to make it worth having a concurrent VM. * Sell that code, make a lot of money. * Buy the rights to Gemstone or some other high-performance, concurrent VM. * Port my code to that instead. * Make a lot more money. Gulik. -- http://people.squeakfoundation.org/person/mikevdg http://gulik.pbwiki.com/ |
In reply to this post by Igor Stasenko
Hello,
I have not thought this through, but it does make me curious. If I understand this right, queue theory says that the time it takes to service an item in the queue is proportional to the number of things in the queue. It seems to me that jobs one might want to throw at a native thread also go into a queue of things waiting to be served by the CPU. How does queue theory play out when a CPU has 1000 cores, I presume at the very best 2x the memory bandwidth we have now, and most programs are written so that they split their work into N pieces as small as possible to get the most out of the available cores? Has anybody looked into this? Perhaps somebody read something worth sharing? Andres. |
In reply to this post by Michael van der Gulik-2
2008/7/8 Michael van der Gulik <[hidden email]>:
> > > If I were working on a concurrent VM, I'd just barge ahead and parallelise > the Squeak VM: > > * I'd refactor the VM so that multiple copies of the interpreter state could > be held in the heap. I'd design it so that each pthread would run one > instance of the standard Squeak interpreter, and so that each interpreter > runs multiple green theads as it does now. This makes forking a very cheap > operation and allows for having as many green threads as would fit in > memory. > * I'd then see what needs fixing in the VM / plug-ins / image to make it > work. I'd probably start with the simple approach: an evil but simple global > VM lock for memory writing operations, and no changes to GC. Later, we can > revisit this to make it scale better. > * I'd then spend the next decade finding and fixing concurrency bugs. > The above is exactly the route on which Hydra VM goes. Btw, in some near future, i think i'll have strong confidence to declare Hydra on windoze in beta stage. Stay tuned :) > What I'm actually going to do is: > > * Modify the Squeak schedular to simulate concurrency better and bring up > lots of concurrency bugs in the image. > * Spend a decade fixing concurrency bugs in the image. > * Write enough concurrent code to make it worth having a concurrent VM. > * Sell that code, make a lot of money. > * Buy the rights to Gemstone or some other high-performance, concurrent VM. > * Port my code to that instead. > * Make a lot more money. > > Gulik. > > > -- > http://people.squeakfoundation.org/person/mikevdg > http://gulik.pbwiki.com/ > > > -- Best regards, Igor Stasenko AKA sig. |
In reply to this post by Igor Stasenko
On Tuesday 08 Jul 2008 3:26:14 am Igor Stasenko wrote:
> It is good to see that they finally trying to use GPUs as generic > purpose processing units. But it has own limitations, like inability > to run different code in its 2^n working units. So it is more press > release than real breakthrough :) The discussions on this thread are on the lines of theatre artists discussing how to get a movie camera to record stage plays. It ignores a whole new class of story-telling possibilities opened up by a such a technology. A 1000-core commodity computing board is not going to be like a quad-core board with 1000 cores instead of 4. It will probably be a hypercube network of communicating cores. Nodes are not only "local" or "remote" but can also be 'neighbors'. Imagine how you could implement Kedama natively on such boards. Instead of having a single-thread VM simulating a world of particles, you could create a particle world super VM which would simulate a single-core VM as one of its "objects". Keeping a single time references across nodes is now easy. This could simplify support for temporal operators. Imagine! Subbu |
In reply to this post by Andreas.Raab
On Mon, 07 Jul 2008 10:08:54 +0200, Andreas Raab wrote:
... > It's not about preventing anything. If you have a proposal for how to do > multiple threads per image I will most definitely listen, Yesterday I've pulled together things (from old and also from more recent drawers) that can make a CroquetMT (MT suffix came from Igor) and sent that material for overnight review to Igor (many thanks to Igor; hope he didn't get distracted from more important projects ;) Of course I had to defend one and another point but the picture remained clear. What came out is this (high level): o MT without locking objects, without per-object owner slot o each native thread has own heap (own ObjectMemory like Hydra) o an MT thread is responsible for messages sent to "its" objects o the main .image has also its MT thread o all other MT threads start with empty image o object allocation is always local, no migration needed o instance creation is easy but too many details for a short post o storing oops cross MT thread is easy but too many details for a short post o same for global vars, easy but also too many details for a short post o GC is local for non-main .images but special for the main .image o no change in existing Smalltalk code necessary, just use it FWIW, parts of the concepts stem from the Goya project (Squeak, coloring of instances) with Alex Bergel. The main principle, which I based on Igor's "islands for CorruptVM" suggestion (island term can be confusing to people when used with this new MT stuff, must find alternate word), is this: - sending a message to a receiver which is not in the current MT thread's "island" causes the message to be scheduled for execution in the other MT thread. - this is independent of the receiver's memory location, "island" is something else. - can be thought of like a FutureRef on which the current process immediately waits. - so as long as receivers are in the same "island" no MT-scheduling happens. - I know this may sound similiar to many other concepts but, hey, we are not there yet. > and if it is a reasonable proposal (i.e., one that can be implemented > with bounded resources) I will even try to find funding for it. I would very much like to get a bounty for a thing like CroquetMT but unfortunately I'm partly disabled (double crunch surgery) so I cannot be a reliable developer in a code-for-money project :( I'd have to employ/hire someone for assistance. So, in case you point to a [patient!] developer then I can discuss details with her/him. Having some first hand experience with Hydra's VM would be a plus. What I do from here is, to put things into a HydraVM (things which just check for the new conditions) to see where the time goes (effort as well as performance). But that will have very slow progress (the FlexDB project has priority for me at the moment). If the above sounds interesting enough then I can email what was discussed with Igor (not excluding anybody ;) > However, until such a time that there is a proposal I will drop this > pointless discussion since, simply put, there is nothing to discuss > here. The only available path at this point is by using one native > thread per image and consequently that's what's going to happen. I fully agree with that path, it's the same for proposed CroquetMT. /Klaus > Cheers, > - Andreas > |
Klaus D. Witzel wrote:
> The main principle, which I based on Igor's "islands for CorruptVM" > suggestion (island term can be confusing to people when used with this > new MT stuff, must find alternate word), is this: island --> continent --> planet --> solar system --> galaxy --> universe ? (Spanish: isla --> continente --> planeta --> Sistema Solar --> galaxia --> universo) (French: île --> ; continent --> ; planète --> ; système solaire --> galaxie --> ; univers) (German: Insel --> Kontinent --> Planet --> Sonnensystem --> Galaxie --> Universum) (Greek: νησί --> ήπειρος --> πλανήτης --> ηλιακό σύστημα --> γαλαξίας--> κόσμος, (in roman alphabet: nesi --> epeiros --> plantes --> eliako systema --> galasias --> kosmos (take this with a large grain of salt!) pints --> quarts --> gallons -> barrels ? David |
2008/7/8 David P Harris <[hidden email]>:
> Klaus D. Witzel wrote: >> >> The main principle, which I based on Igor's "islands for CorruptVM" >> suggestion (island term can be confusing to people when used with this new >> MT stuff, must find alternate word), is this: > > island --> continent --> planet --> solar system --> galaxy --> universe ? > (Spanish: isla --> continente --> planeta --> Sistema Solar --> galaxia --> > universo) > (French: île --> ; continent --> ; planète --> ; système solaire --> galaxie > --> ; univers) > (German: Insel --> Kontinent --> Planet --> Sonnensystem --> Galaxie --> > Universum) > (Greek: νησί --> ήπειρος --> πλανήτης --> ηλιακό σύστημα --> γαλαξίας--> > κόσμος, > (in roman alphabet: nesi --> epeiros --> plantes --> eliako systema --> > galasias --> kosmos (take this with a large grain of salt!) > > pints --> quarts --> gallons -> barrels ? > > David is very precise word in terms of parallel computing: Islands are isolated from each other. To travel from one island to another you need to cross the water. -- Best regards, Igor Stasenko AKA sig. |
On Jul 8, 2008, at 5:56 PM, Igor Stasenko wrote:
> 2008/7/8 David P Harris <[hidden email]>: >> Klaus D. Witzel wrote: >>> >>> The main principle, which I based on Igor's "islands for CorruptVM" >>> suggestion (island term can be confusing to people when used with >>> this new >>> MT stuff, must find alternate word), is this: >> >> island --> continent --> planet --> solar system --> galaxy --> >> universe ? >> (Spanish: isla --> continente --> planeta --> Sistema Solar --> >> galaxia --> >> universo) >> (French: île --> ; continent --> ; planète --> ; système solaire >> --> galaxie >> --> ; univers) >> (German: Insel --> Kontinent --> Planet --> Sonnensystem --> >> Galaxie --> >> Universum) >> (Greek: νησί --> ήπειρος --> πλανήτης --> >> ηλιακό σύστημα --> γαλαξίας--> >> κόσμος, >> (in roman alphabet: nesi --> epeiros --> plantes --> eliako systema >> --> >> galasias --> kosmos (take this with a large grain of salt!) >> >> pints --> quarts --> gallons -> barrels ? >> >> David > > Its not confusing to those, who ever heard about Croquet. And island > is very precise word in terms of parallel computing: > Islands are isolated from each other. To travel from one island to > another you need to cross the water. > I think that Klaus is saying (forgive me if I'm wrong) that "Island" is confusing because it already has meaning in Tweak and Croquet. However, I think that the meaning is the same (leaving aside Croquet's notion of replicaion), so there's no need for a new term. I also like the term for the same reason that you do (much better than E's "vat"). Cheers, Josh > -- > Best regards, > Igor Stasenko AKA sig. > |
Free forum by Nabble | Edit this page |