digitalmars.D - DMD 0.99 release
- Walter (2/2) Aug 19 2004 Lots more bug fixes. Added special 'length' inside array [ ]'s.
- kinghajj (2/3) Aug 19 2004 meaning ? ... (example please)
-
Carlos Santander B.
(13/13)
Aug 19 2004
"kinghajj"
escribió en el mensaje - Derek Parnell (8/14) Aug 19 2004 char[] myarray = "abcdefghij";
- kinghajj (2/16) Aug 19 2004 Oh, ok, that's cool!
- Ben Hinkle (5/8) Aug 19 2004 I don't suppose there's any way to get that sugar for things that implem...
- Walter (7/15) Aug 19 2004 implement
- Matthew (4/21) Aug 19 2004 Yikes no.
- Walter (7/30) Aug 19 2004 news:cg3sh1$2qr1$1@digitaldaemon.com...
- Matthew (6/39) Aug 19 2004 I like Chris' suggestion of opLength(), but if not I'd settle for the co...
- Sean Kelly (8/11) Aug 20 2004 D already supports this in reverse for arrays. ie. length(T[] x) can be...
- Matthew (3/16) Aug 20 2004 Certainly, one the main points is to keep handling of all types consiste...
- Thomas Kuehne (6/12) Aug 20 2004 I strongly opose this. This will break lots of existing length() etc.
- Matthew (3/11) Aug 19 2004 I never considered that that was _not_ the case. Please say that is inde...
- Walter (7/20) Aug 19 2004 news:cg3oug$2ond$1@digitaldaemon.com...
- Vathix (5/6) Aug 19 2004 I think it's pretty cool, but might cause logic bugs. I'm just glad I've
- Matthew (3/10) Aug 19 2004 At first I thought yuck. But mere seconds later, I think Yes!
- Walter (8/18) Aug 19 2004 news:cg3trp$2s1u$1@digitaldaemon.com...
- Matthew (2/22) Aug 19 2004 Oh sure, we agree on the syntax. Just that the special symbol for the le...
- Daniel Horn (2/20) Aug 20 2004
- Matthew (4/5) Aug 19 2004 Excellent. I really can't imagine this causing more than a very few falt...
- Walter (8/13) Aug 19 2004 faltering steps for each developer, and a
- Matthew (10/26) Aug 19 2004 No. Checking out ...
- Walter (17/31) Aug 20 2004 news:cg40au$2thv$4@digitaldaemon.com...
- Sean Kelly (7/11) Aug 20 2004 Probably. Though it might be nice to formalize hooks for library writer...
- Sean Kelly (11/37) Aug 20 2004 It's been a while since I checked that thread--thanks for the reminder, ...
- antiAlias (7/11) Aug 19 2004 About time too! On that note, mango.cache has a port of Doug Lea's
- Matthew (2/13) Aug 19 2004 We'll get that one into DTL, if you don't mind. :)
- antiAlias (11/25) Aug 20 2004 No problem. Just pull it out of the (browser enabled) dsource.org
- Matthew (13/42) Aug 20 2004 [I'm cross posting to dtl group. Can you *only* answer in that group, an...
- Walter (11/14) Aug 20 2004 AFAIK, D's volatile speaks to intra-thread
- Sean Kelly (6/20) Aug 20 2004 Yup. Andrei and Scott co-wrote articles in the July and August editions...
- Matthew (4/18) Aug 20 2004 Ok.
- Walter (12/32) Aug 21 2004 news:cg59uu$gfi$1@digitaldaemon.com...
- Sean Kelly (9/12) Aug 27 2004 The discussions on threading in comp.std.c++ are getting pretty involved...
- antiAlias (19/63) Aug 20 2004 layout, etc., so I'd be looking to reformat it
- Walter (5/13) Aug 20 2004 former
- Sean Kelly (6/19) Aug 20 2004 It might be nice to also offer a way to separate acquire/release semanti...
- Matthew (7/28) Aug 20 2004 Can we do block volatile, as in:
- Sean Kelly (40/70) Aug 20 2004 volatile is a statement specifier, so yes. Is it meaningful? I think i...
- antiAlias (59/98) Aug 20 2004 You'll forgive me Sean, but the double-locking 'style' was driven out of
- Sean Kelly (7/42) Aug 20 2004 That's fine :) I mostly used it as an example beceause I had the Andrei...
- Walter (3/4) Aug 22 2004 You'll get an error about circular dependencies.
- Walter (11/59) Aug 22 2004 have
- Gold Dragon (3/12) Aug 20 2004 What type is tmp? Wouldn't you get a compiler error if you don't put the...
- Sean Kelly (4/16) Aug 20 2004 Its type is Singleton. tmp was delcared in the first line of the functi...
- Sean Kelly (4/24) Aug 21 2004 err... I meant:
- Matthew (2/70) Aug 20 2004
- Ben Hinkle (7/11) Aug 20 2004 Interesting. That 64-bit CAS posting I made on digitalmars.D.bugs was in
- pragma (13/24) Aug 20 2004 Neat stuff Ben. Here's something that'll help if you haven't done this ...
- Ben Hinkle (13/41) Aug 20 2004 comp.lang.c++.moderated
- clayasaurus (2/7) Aug 19 2004 Walter, have you got std.loader compiled into phobos on linux?
- Matthew (7/14) Aug 19 2004 Good question.
- clayasaurus (5/29) Aug 20 2004 Hey Matthew I think std.loader is a nice piece of code and was
- clayasaurus (4/28) Aug 20 2004 I just checked and loader.o is still missing from libphobos.a on linux.
- Matthew (3/31) Aug 20 2004 Indeed. Let's hope he does so. :-)
- Russ Lewis (3/3) Aug 20 2004 Walter wrote:
- David L. Davis (8/10) Aug 20 2004 Walter: Thxs a lot for adding in the ifind() and irfind() functions into...
Lots more bug fixes. Added special 'length' inside array [ ]'s. http://www.digitalmars.com/d/changelog.html
Aug 19 2004
In article <cg3n60$2oap$1 digitaldaemon.com>, Walter says...Added special 'length' inside array [ ]'s.meaning ? ... (example please)
Aug 19 2004
"kinghajj" <kinghajj_member pathlink.com> escribió en el mensaje news:cg3oju$2p20$1 digitaldaemon.com | In article <cg3n60$2oap$1 digitaldaemon.com>, Walter says... || || Added special 'length' inside array [ ]'s. || | | meaning ? ... (example please) Look for "Array Length" in arrays.html: "Within the [ ] of a static or a dynamic array, the variable length is implicitly declared and set to the length of the array." ----------------------- Carlos Santander Bernal
Aug 19 2004
On Fri, 20 Aug 2004 02:45:18 +0000 (UTC), kinghajj wrote:In article <cg3n60$2oap$1 digitaldaemon.com>, Walter says...char[] myarray = "abcdefghij"; writef(myarray[length-3 .. length ] output ==> "hij" -- Derek Melbourne, Australia 20/Aug/04 12:47:50 PMAdded special 'length' inside array [ ]'s.meaning ? ... (example please)
Aug 19 2004
In article <cg3or0$2p3k$1 digitaldaemon.com>, Derek Parnell says...On Fri, 20 Aug 2004 02:45:18 +0000 (UTC), kinghajj wrote:Oh, ok, that's cool!In article <cg3n60$2oap$1 digitaldaemon.com>, Walter says...char[] myarray = "abcdefghij"; writef(myarray[length-3 .. length ] output ==> "hij" -- Derek Melbourne, Australia 20/Aug/04 12:47:50 PMAdded special 'length' inside array [ ]'s.meaning ? ... (example please)
Aug 19 2004
Walter wrote:Lots more bug fixes. Added special 'length' inside array [ ]'s. http://www.digitalmars.com/d/changelog.htmlI don't suppose there's any way to get that sugar for things that implement opIndex, opSlice, etc. Or that that work already? I'm thinking that if x is an instance of class Foo and Foo defined opIndex and length() then x[length-1] is the same as x.opIndex(x.length-1).
Aug 19 2004
"Ben Hinkle" <bhinkle4 juno.com> wrote in message news:cg3oug$2ond$1 digitaldaemon.com...Walter wrote:implementLots more bug fixes. Added special 'length' inside array [ ]'s. http://www.digitalmars.com/d/changelog.htmlI don't suppose there's any way to get that sugar for things thatopIndex, opSlice, etc. Or that that work already? I'm thinking that if xisan instance of class Foo and Foo defined opIndex and length() then x[length-1] is the same as x.opIndex(x.length-1).That does need to be done. I was thinking that an implicit 'with' statement could happen, and then all the members of the class instance would be usable.
Aug 19 2004
"Walter" <newshound digitalmars.com> wrote in message news:cg3sh1$2qr1$1 digitaldaemon.com..."Ben Hinkle" <bhinkle4 juno.com> wrote in message news:cg3oug$2ond$1 digitaldaemon.com...Yikes no. Please, in the words of the expository master: "do as the ints do" and the relativistic master: "as simple as possible, but no simpler".Walter wrote:implementLots more bug fixes. Added special 'length' inside array [ ]'s. http://www.digitalmars.com/d/changelog.htmlI don't suppose there's any way to get that sugar for things thatopIndex, opSlice, etc. Or that that work already? I'm thinking that if xisan instance of class Foo and Foo defined opIndex and length() then x[length-1] is the same as x.opIndex(x.length-1).That does need to be done. I was thinking that an implicit 'with' statement could happen, and then all the members of the class instance would be usable.
Aug 19 2004
"Matthew" <admin.hat stlsoft.dot.org> wrote in message news:cg3v1i$2t3r$1 digitaldaemon.com..."Walter" <newshound digitalmars.com> wrote in messagenews:cg3sh1$2qr1$1 digitaldaemon.com...x"Ben Hinkle" <bhinkle4 juno.com> wrote in message news:cg3oug$2ond$1 digitaldaemon.com...Walter wrote:implementLots more bug fixes. Added special 'length' inside array [ ]'s. http://www.digitalmars.com/d/changelog.htmlI don't suppose there's any way to get that sugar for things thatopIndex, opSlice, etc. Or that that work already? I'm thinking that ifstatementisan instance of class Foo and Foo defined opIndex and length() then x[length-1] is the same as x.opIndex(x.length-1).That does need to be done. I was thinking that an implicit 'with'relativistic master: "as simple as possible,could happen, and then all the members of the class instance would be usable.Yikes no. Please, in the words of the expository master: "do as the ints do" and thebut no simpler".How else to supply the length? Just make that member visible?
Aug 19 2004
"Walter" <newshound digitalmars.com> wrote in message news:cg40as$2thv$1 digitaldaemon.com..."Matthew" <admin.hat stlsoft.dot.org> wrote in message news:cg3v1i$2t3r$1 digitaldaemon.com...I like Chris' suggestion of opLength(), but if not I'd settle for the compiler making length a special case. Of course, if it's going to be a special case, then why not an operator. And if that's the case, then what about allowing the Python like syntax int l = length(x); // Equivalent to int l = x.length; I'm not proposing this last bit, mind, just interested in hearing opinions on the matter."Walter" <newshound digitalmars.com> wrote in messagenews:cg3sh1$2qr1$1 digitaldaemon.com...x"Ben Hinkle" <bhinkle4 juno.com> wrote in message news:cg3oug$2ond$1 digitaldaemon.com...Walter wrote:implementLots more bug fixes. Added special 'length' inside array [ ]'s. http://www.digitalmars.com/d/changelog.htmlI don't suppose there's any way to get that sugar for things thatopIndex, opSlice, etc. Or that that work already? I'm thinking that ifstatementisan instance of class Foo and Foo defined opIndex and length() then x[length-1] is the same as x.opIndex(x.length-1).That does need to be done. I was thinking that an implicit 'with'relativistic master: "as simple as possible,could happen, and then all the members of the class instance would be usable.Yikes no. Please, in the words of the expository master: "do as the ints do" and thebut no simpler".How else to supply the length? Just make that member visible?
Aug 19 2004
In article <cg412i$2tt9$1 digitaldaemon.com>, Matthew says...And if that's the case, then what about allowing the Python like syntax int l = length(x); // Equivalent to int l = x.length; I'm not proposing this last bit, mind, just interested in hearing opinions on the matter.D already supports this in reverse for arrays. ie. length(T[] x) can be called as: length(x) or x.length. Since this is the case, and assuming it hasn't already been done, it would be nice to expose the default parameters as D functions. So we could call sizeof(x), length(x), etc. By the same token, it would be nice to have this be consistent for all primitive types rather than just for array types. Sean
Aug 20 2004
"Sean Kelly" <sean f4.ca> wrote in message news:cg5e3f$iep$1 digitaldaemon.com...In article <cg412i$2tt9$1 digitaldaemon.com>, Matthew says...Certainly, one the main points is to keep handling of all types consistent. And, yes, I like the application the principle of sizeof() also.And if that's the case, then what about allowing the Python like syntax int l = length(x); // Equivalent to int l = x.length; I'm not proposing this last bit, mind, just interested in hearing opinions on the matter.D already supports this in reverse for arrays. ie. length(T[] x) can be called as: length(x) or x.length. Since this is the case, and assuming it hasn't already been done, it would be nice to expose the default parameters as D functions. So we could call sizeof(x), length(x), etc. By the same token, it would be nice to have this be consistent for all primitive types rather than just for array types.
Aug 20 2004
Sean Kelly schrieb in <cg5e3f$iep$1 digitaldaemon.com>:D already supports this in reverse for arrays. ie. length(T[] x) can be called as: length(x) or x.length. Since this is the case, and assuming it hasn't already been done, it would be nice to expose the default parameters as D functions. So we could call sizeof(x), length(x), etc. By the same token, it would be nice to have this be consistent for all primitive types rather than just for array types.I strongly opose this. This will break lots of existing length() etc. functions. If ever enable this only when a special pragma switch is included in the sources. Thomas
Aug 20 2004
"Ben Hinkle" <bhinkle4 juno.com> wrote in message news:cg3oug$2ond$1 digitaldaemon.com...Walter wrote:I never considered that that was _not_ the case. Please say that is indeed how it works, big-W. If not, count this a loud vote for that consistency. :)Lots more bug fixes. Added special 'length' inside array [ ]'s. http://www.digitalmars.com/d/changelog.htmlI don't suppose there's any way to get that sugar for things that implement opIndex, opSlice, etc. Or that that work already? I'm thinking that if x is an instance of class Foo and Foo defined opIndex and length() then x[length-1] is the same as x.opIndex(x.length-1).
Aug 19 2004
"Matthew" <admin.hat stlsoft.dot.org> wrote in message news:cg3uu9$2t1b$1 digitaldaemon.com..."Ben Hinkle" <bhinkle4 juno.com> wrote in messagenews:cg3oug$2ond$1 digitaldaemon.com...implementWalter wrote:Lots more bug fixes. Added special 'length' inside array [ ]'s. http://www.digitalmars.com/d/changelog.htmlI don't suppose there's any way to get that sugar for things thatisopIndex, opSlice, etc. Or that that work already? I'm thinking that if xhow it works, big-W.an instance of class Foo and Foo defined opIndex and length() then x[length-1] is the same as x.opIndex(x.length-1).I never considered that that was _not_ the case. Please say that is indeedIf not, count this a loud vote for that consistency. :)Right now it only works for arrays.
Aug 19 2004
Added special 'length' inside array [ ]'s.I think it's pretty cool, but might cause logic bugs. I'm just glad I've been lazy in naming my variables len instead of length. Perhaps it should be illegal to name something length, and just allow classes/structs/unions to have an opLength() ? It would also be helpful for people porting from another language. length is a pretty popular name.
Aug 19 2004
"Vathix" <vathixSpamFix dprogramming.com> wrote in message news:cg3trp$2s1u$1 digitaldaemon.com...At first I thought yuck. But mere seconds later, I think Yes! Please add me onto this soon-to-huge list of Yeah-sayersAdded special 'length' inside array [ ]'s.I think it's pretty cool, but might cause logic bugs. I'm just glad I've been lazy in naming my variables len instead of length. Perhaps it should be illegal to name something length, and just allow classes/structs/unions to have an opLength() ? It would also be helpful for people porting from another language. length is a pretty popular name.
Aug 19 2004
"Matthew" <admin.hat stlsoft.dot.org> wrote in message news:cg3v1j$2t3r$2 digitaldaemon.com..."Vathix" <vathixSpamFix dprogramming.com> wrote in messagenews:cg3trp$2s1u$1 digitaldaemon.com...should beAdded special 'length' inside array [ ]'s.I think it's pretty cool, but might cause logic bugs. I'm just glad I've been lazy in naming my variables len instead of length. Perhaps ittoillegal to name something length, and just allow classes/structs/unionsMost of the proposals involved things like using a special token like $, but I thought we're already using length, so why not just continue that direction?have an opLength() ? It would also be helpful for people porting from another language. length is a pretty popular name.At first I thought yuck. But mere seconds later, I think Yes!
Aug 19 2004
"Walter" <newshound digitalmars.com> wrote in message news:cg40at$2thv$3 digitaldaemon.com..."Matthew" <admin.hat stlsoft.dot.org> wrote in message news:cg3v1j$2t3r$2 digitaldaemon.com...Oh sure, we agree on the syntax. Just that the special symbol for the length operator should be, er, "length". :-)"Vathix" <vathixSpamFix dprogramming.com> wrote in messagenews:cg3trp$2s1u$1 digitaldaemon.com...should beAdded special 'length' inside array [ ]'s.I think it's pretty cool, but might cause logic bugs. I'm just glad I've been lazy in naming my variables len instead of length. Perhaps ittoillegal to name something length, and just allow classes/structs/unionsMost of the proposals involved things like using a special token like $, but I thought we're already using length, so why not just continue that direction?have an opLength() ? It would also be helpful for people porting from another language. length is a pretty popular name.At first I thought yuck. But mere seconds later, I think Yes!
Aug 19 2004
awesome idea :-) Matthew wrote:"Vathix" <vathixSpamFix dprogramming.com> wrote in message news:cg3trp$2s1u$1 digitaldaemon.com...At first I thought yuck. But mere seconds later, I think Yes! Please add me onto this soon-to-huge list of Yeah-sayersAdded special 'length' inside array [ ]'s.I think it's pretty cool, but might cause logic bugs. I'm just glad I've been lazy in naming my variables len instead of length. Perhaps it should be illegal to name something length, and just allow classes/structs/unions to have an opLength() ? It would also be helpful for people porting from another language. length is a pretty popular name.
Aug 20 2004
Added special 'length' inside array [ ]'s.Excellent. I really can't imagine this causing more than a very few faltering steps for each developer, and a considerable, albiet sugary, syntactic simplification. Now, how do I go about raising the issue of D providing thread-agnostic implicit reg-exp, a la Perl and Ruby? (I'm not kidding!)
Aug 19 2004
"Matthew" <admin.hat stlsoft.dot.org> wrote in message news:cg3usm$2t04$1 digitaldaemon.com...faltering steps for each developer, and aAdded special 'length' inside array [ ]'s.Excellent. I really can't imagine this causing more than a very fewconsiderable, albiet sugary, syntactic simplification. Now, how do I go about raising the issue of D providing thread-agnosticimplicit reg-exp, a la Perl and Ruby?(I'm not kidding!)2.0. BTW, are you following Andrei A's thread on adding lock-free concurrent containers to C++? It's a great read in comp.lang.c++.moderated under the thread "Multithreaded programming: is the C++ standardization committee listening?"
Aug 19 2004
"Walter" <newshound digitalmars.com> wrote in message news:cg40au$2thv$4 digitaldaemon.com..."Matthew" <admin.hat stlsoft.dot.org> wrote in message news:cg3usm$2t04$1 digitaldaemon.com...No. Checking out ... Sounds like Andrei's demanding for C++ what I've said to you several times that we _could_ achieve for D (given that I share the view with some of the respondents that it's not possible/practicable for C++). Atomic ops, lock-free containers, etc. etc. We can do it. (But maybe this has to be 2.0 stuff.) I'm interested right now in whether reading that thread's made you more or less interested in native threading support for D than you were the last time we discussed it? (btw, if doing this made D lose some of the odd little platforms it might conceivably be ported to, I believe that would be a worthy pact, since this would be one area in which D would be manifestly superior to C++. Has that got your juices flowing ???)faltering steps for each developer, and aAdded special 'length' inside array [ ]'s.Excellent. I really can't imagine this causing more than a very fewconsiderable, albiet sugary, syntactic simplification. Now, how do I go about raising the issue of D providing thread-agnosticimplicit reg-exp, a la Perl and Ruby?(I'm not kidding!)2.0. BTW, are you following Andrei A's thread on adding lock-free concurrent containers to C++? It's a great read in comp.lang.c++.moderated under the thread "Multithreaded programming: is the C++ standardization committee listening?"
Aug 19 2004
"Matthew" <admin.hat stlsoft.dot.org> wrote in message news:cg412k$2tt9$3 digitaldaemon.com..."Walter" <newshound digitalmars.com> wrote in messagenews:cg40au$2thv$4 digitaldaemon.com...concurrent2.0. BTW, are you following Andrei A's thread on adding lock-freethecontainers to C++? It's a great read in comp.lang.c++.moderated underthat we _could_ achieve for D (given that Ithread "Multithreaded programming: is the C++ standardization committee listening?"No. Checking out ... Sounds like Andrei's demanding for C++ what I've said to you several timesshare the view with some of the respondents that it's notpossible/practicable for C++).Atomic ops, lock-free containers, etc. etc. We can do it. (But maybe thishas to be 2.0 stuff.)I'm interested right now in whether reading that thread's made you more orless interested in native threading supportfor D than you were the last time we discussed it?I've always been interested in support for threading, that's why the synchronize primitives are there, as well as the volatile statement. I'm not sure what else needs to happen in the core language, isn't the rest mostly a library issue?(btw, if doing this made D lose some of the odd little platforms it mightconceivably be ported to, I believe that wouldbe a worthy pact, since this would be one area in which D would bemanifestly superior to C++. Has that got your juicesflowing ???)I don't see a problem there, platforms that don't support multithreading will just have noops for the sync primitives.
Aug 20 2004
In article <cg4802$30v7$1 digitaldaemon.com>, Walter says...I've always been interested in support for threading, that's why the synchronize primitives are there, as well as the volatile statement. I'm not sure what else needs to happen in the core language, isn't the rest mostly a library issue?Probably. Though it might be nice to formalize hooks for library writers to manipulate the built-in synchronization blocks. Also, there may be some advantage to having language support for condvars, though I haven't thought enough about this to know whether merely adding a new attribute would be sufficient. Sean
Aug 20 2004
In article <cg412k$2tt9$3 digitaldaemon.com>, Matthew says..."Walter" <newshound digitalmars.com> wrote in message news:cg40au$2thv$4 digitaldaemon.com...It's been a while since I checked that thread--thanks for the reminder, Walter. I think D already has laid some decent groundwork for this with the revised volatile semantics, etc. It would be logical to extend this to support the things that Andrei mentions, though I expect that much of this might not make it in until 2.0."Matthew" <admin.hat stlsoft.dot.org> wrote in message news:cg3usm$2t04$1 digitaldaemon.com...No. Checking out ... Sounds like Andrei's demanding for C++ what I've said to you several times that we _could_ achieve for D (given that I share the view with some of the respondents that it's not possible/practicable for C++). Atomic ops, lock-free containers, etc. etc. We can do it. (But maybe this has to be 2.0 stuff.)faltering steps for each developer, and aAdded special 'length' inside array [ ]'s.Excellent. I really can't imagine this causing more than a very fewconsiderable, albiet sugary, syntactic simplification. Now, how do I go about raising the issue of D providing thread-agnosticimplicit reg-exp, a la Perl and Ruby?(I'm not kidding!)2.0. BTW, are you following Andrei A's thread on adding lock-free concurrent containers to C++? It's a great read in comp.lang.c++.moderated under the thread "Multithreaded programming: is the C++ standardization committee listening?"(btw, if doing this made D lose some of the odd little platforms it might conceivably be ported to, I believe that would be a worthy pact, since this would be one area in which D would be manifestly superior to C++. Has that got your juices flowing ???)Heck yes. It remains to be seen how much of Boost.Threads makes it into C++ 0x, but even that is just a collection of library routines rather than native language support. Between Unicode support and multithreading, D has a lot going for it over C++. Sean
Aug 20 2004
Walter" <newshound digitalmars.com> wrote in message2.0. BTW, are you following Andrei A's thread on adding lock-freeconcurrentcontainers to C++? It's a great read in comp.lang.c++.moderated under the thread "Multithreaded programming: is the C++ standardization committee listening?"About time too! On that note, mango.cache has a port of Doug Lea's latest-and-greatest concurrent HashMap. Nice,clean, concise bit of code, configurable (contention-level) and very efficient: no read-locks at all. Also has foreach() support. I suggest this migrate into one of the container libs rather than slumbering quietly within Mango.
Aug 19 2004
"antiAlias" <fu bar.com> wrote in message news:cg41s8$2u61$1 digitaldaemon.com...Walter" <newshound digitalmars.com> wrote in messageWe'll get that one into DTL, if you don't mind. :)2.0. BTW, are you following Andrei A's thread on adding lock-freeconcurrentcontainers to C++? It's a great read in comp.lang.c++.moderated under the thread "Multithreaded programming: is the C++ standardization committee listening?"About time too! On that note, mango.cache has a port of Doug Lea's latest-and-greatest concurrent HashMap. Nice,clean, concise bit of code, configurable (contention-level) and very efficient: no read-locks at all. Also has foreach() support. I suggest this migrate into one of the container libs rather than slumbering quietly within Mango.
Aug 19 2004
No problem. Just pull it out of the (browser enabled) dsource.org repository. The documentation needs a wee bit of attention :~) Let's share updates (on that module) until we get some resolution on how to easily resolve multiple interdependent libraries ... "Matthew" <admin.hat stlsoft.dot.org> wrote in message news:cg42kq$2ubh$1 digitaldaemon.com..."antiAlias" <fu bar.com> wrote in messagenews:cg41s8$2u61$1 digitaldaemon.com...theWalter" <newshound digitalmars.com> wrote in message2.0. BTW, are you following Andrei A's thread on adding lock-freeconcurrentcontainers to C++? It's a great read in comp.lang.c++.moderated undercommitteethread "Multithreaded programming: is the C++ standardizationall.listening?"About time too! On that note, mango.cache has a port of Doug Lea's latest-and-greatest concurrent HashMap. Nice,clean, concise bit of code, configurable (contention-level) and very efficient: no read-locks atcontainerAlso has foreach() support. I suggest this migrate into one of thelibs rather than slumbering quietly within Mango.We'll get that one into DTL, if you don't mind. :)
Aug 20 2004
[I'm cross posting to dtl group. Can you *only* answer in that group, and then we've move it over nicely. :)] Done. I like the look of it so far. I don't think we're going to be able to keep it in the same format for DTL, though. If you don't mind, I'd rather keep the container implementations as consistent as possible, in terms of layout, etc., so I'd be looking to reformat it considerably. Obviously there'll be deeper changes as well, such as templatisation, and incorporation of the composable range transformations/filters. Question: what's the purpose of using "volatile" in various places. Since, AFAIK, D's volatile speaks to intra-thread memory coherence, and do not cross-thread contention, aren't these superfluous? Or have you come across some secret wisdom? (If so, send it to me quickly, via the secret T1!) Matthew "antiAlias" <fu bar.com> wrote in message news:cg48q9$ma$1 digitaldaemon.com...No problem. Just pull it out of the (browser enabled) dsource.org repository. The documentation needs a wee bit of attention :~) Let's share updates (on that module) until we get some resolution on how to easily resolve multiple interdependent libraries ... "Matthew" <admin.hat stlsoft.dot.org> wrote in message news:cg42kq$2ubh$1 digitaldaemon.com..."antiAlias" <fu bar.com> wrote in messagenews:cg41s8$2u61$1 digitaldaemon.com...theWalter" <newshound digitalmars.com> wrote in message2.0. BTW, are you following Andrei A's thread on adding lock-freeconcurrentcontainers to C++? It's a great read in comp.lang.c++.moderated undercommitteethread "Multithreaded programming: is the C++ standardizationall.listening?"About time too! On that note, mango.cache has a port of Doug Lea's latest-and-greatest concurrent HashMap. Nice,clean, concise bit of code, configurable (contention-level) and very efficient: no read-locks atcontainerAlso has foreach() support. I suggest this migrate into one of thelibs rather than slumbering quietly within Mango.We'll get that one into DTL, if you don't mind. :)
Aug 20 2004
"Matthew" <admin.hat stlsoft.dot.org> wrote in message news:cg4b8t$1pd$2 digitaldaemon.com...Question: what's the purpose of using "volatile" in various places. Since,AFAIK, D's volatile speaks to intra-threadmemory coherence, and do not cross-thread contention, aren't thesesuperfluous? Or have you come across some secretwisdom? (If so, send it to me quickly, via the secret T1!)D's volatile has essentially nothing in common with C's, and everything to do with helping with writing multithreaded apps. I learned about it from Scott Meyer's talk on multithreading. As I recall, it was about preventing the compiler from moving loads and stores across locks. C++ has no such guarantee, although C++ optimizers in reality respect the locks. This is the definitions of volatile to suit as well.
Aug 20 2004
In article <cg59uu$gfi$1 digitaldaemon.com>, Walter says..."Matthew" <admin.hat stlsoft.dot.org> wrote in message news:cg4b8t$1pd$2 digitaldaemon.com...Yup. Andrei and Scott co-wrote articles in the July and August editions of DDJ about this ("C++ and the Perils of Double-Checked Locking"). There was also a thread about it in comp.std.c++. It all boils down to the evil of the "as-if" rule. SeanQuestion: what's the purpose of using "volatile" in various places. Since,AFAIK, D's volatile speaks to intra-threadmemory coherence, and do not cross-thread contention, aren't thesesuperfluous? Or have you come across some secretwisdom? (If so, send it to me quickly, via the secret T1!)D's volatile has essentially nothing in common with C's, and everything to do with helping with writing multithreaded apps. I learned about it from Scott Meyer's talk on multithreading. As I recall, it was about preventing the compiler from moving loads and stores across locks. C++ has no such guarantee, although C++ optimizers in reality respect the locks. This is the definitions of volatile to suit as well.
Aug 20 2004
"Walter" <newshound digitalmars.com> wrote in message news:cg59uu$gfi$1 digitaldaemon.com..."Matthew" <admin.hat stlsoft.dot.org> wrote in message news:cg4b8t$1pd$2 digitaldaemon.com...Ok. But I'll need you to fine-grain some examples for me before that coallesces into a genuine understanding. Maybe we can do this in written form somewhere soon? ;)Question: what's the purpose of using "volatile" in various places. Since,AFAIK, D's volatile speaks to intra-threadmemory coherence, and do not cross-thread contention, aren't thesesuperfluous? Or have you come across some secretwisdom? (If so, send it to me quickly, via the secret T1!)D's volatile has essentially nothing in common with C's, and everything to do with helping with writing multithreaded apps. I learned about it from Scott Meyer's talk on multithreading. As I recall, it was about preventing the compiler from moving loads and stores across locks. C++ has no such guarantee, although C++ optimizers in reality respect the locks. This is the definitions of volatile to suit as well.
Aug 20 2004
"Matthew" <admin.hat stlsoft.dot.org> wrote in message news:cg5tjc$sdr$1 digitaldaemon.com..."Walter" <newshound digitalmars.com> wrote in messagenews:cg59uu$gfi$1 digitaldaemon.com...Since,"Matthew" <admin.hat stlsoft.dot.org> wrote in message news:cg4b8t$1pd$2 digitaldaemon.com...Question: what's the purpose of using "volatile" in various places.toAFAIK, D's volatile speaks to intra-threadmemory coherence, and do not cross-thread contention, aren't thesesuperfluous? Or have you come across some secretwisdom? (If so, send it to me quickly, via the secret T1!)D's volatile has essentially nothing in common with C's, and everythingpreventingdo with helping with writing multithreaded apps. I learned about it from Scott Meyer's talk on multithreading. As I recall, it was aboutthethe compiler from moving loads and stores across locks. C++ has no such guarantee, although C++ optimizers in reality respect the locks. This istheircoallesces into a genuine understanding.definitions of volatile to suit as well.Ok. But I'll need you to fine-grain some examples for me before thatMaybe we can do this in written form somewhere soon? ;)See the July and August DDJ's by Andrei and Scott. They understand the issues far better than I, and my brain hurts every time I try to figure it out again.
Aug 21 2004
In article <cg7361$1mmk$1 digitaldaemon.com>, Walter says...See the July and August DDJ's by Andrei and Scott. They understand the issues far better than I, and my brain hurts every time I try to figure it out again.The discussions on threading in comp.std.c++ are getting pretty involved, so any of those would be a good resource. And lurking on comp.lang.threads is always helpful, though it can take some searching to catch up on the lingo. It seems there's a pretty big movement towards lockless thread synchronization, and D is already in a better position than most other languages to take advantage of this. I know that Ben was working on some lockless containers... I'll have to find some time to check them out. Sean
Aug 27 2004
"Matthew" wrote ...I don't think we're going to be able to keep it in the same format forDTL, though. If you don't mind, I'd rather keepthe container implementations as consistent as possible, in terms oflayout, etc., so I'd be looking to reformat itconsiderably. Obviously there'll be deeper changes as well, such as templatisation, andincorporation of the composable rangetransformations/filters.Sure ... edit with aplomb <g>Question: what's the purpose of using "volatile" in various places. Since,AFAIK, D's volatile speaks to intra-threadmemory coherence, and do not cross-thread contention, aren't thesesuperfluous? Or have you come across some secretwisdom? (If so, send it to me quickly, via the secret T1!)That's the difference between the Java/C++ and D implementation. The former tag the variable itself, while D tags the usage. I think the D approach to the "memory-barrier" thing is the 'correct' one, but it may lead to obtuse and hard-to-find bugs. For instance, you have to manually and carefully add the volatile tag to each usage, rather than the compiler doing it for you (in the Java/C++ case). D, however, gives you more flexibility and control over how/where the barrier is applied. I think that's accurate ... someone please correct me if I'm wrong.Matthew "antiAlias" <fu bar.com> wrote in messagenews:cg48q9$ma$1 digitaldaemon.com...toNo problem. Just pull it out of the (browser enabled) dsource.org repository. The documentation needs a wee bit of attention :~) Let's share updates (on that module) until we get some resolution on howundereasily resolve multiple interdependent libraries ... "Matthew" <admin.hat stlsoft.dot.org> wrote in message news:cg42kq$2ubh$1 digitaldaemon.com..."antiAlias" <fu bar.com> wrote in messagenews:cg41s8$2u61$1 digitaldaemon.com...Walter" <newshound digitalmars.com> wrote in message2.0. BTW, are you following Andrei A's thread on adding lock-freeconcurrentcontainers to C++? It's a great read in comp.lang.c++.moderatedcode,thecommitteethread "Multithreaded programming: is the C++ standardizationlistening?"About time too! On that note, mango.cache has a port of Doug Lea's latest-and-greatest concurrent HashMap. Nice,clean, concise bit ofall.configurable (contention-level) and very efficient: no read-locks atcontainerAlso has foreach() support. I suggest this migrate into one of thelibs rather than slumbering quietly within Mango.We'll get that one into DTL, if you don't mind. :)
Aug 20 2004
"antiAlias" <fu bar.com> wrote in message news:cg5i6n$l3k$1 digitaldaemon.com...That's the difference between the Java/C++ and D implementation. Theformertag the variable itself, while D tags the usage. I think the D approach to the "memory-barrier" thing is the 'correct' one, but it may lead to obtuse and hard-to-find bugs. For instance, you have to manually and carefullyaddthe volatile tag to each usage, rather than the compiler doing it for you (in the Java/C++ case). D, however, gives you more flexibility and control over how/where the barrier is applied. I think that's accurate ... someone please correct me if I'm wrong.I think you've got it right.
Aug 20 2004
In article <cg5jfh$lr9$1 digitaldaemon.com>, Walter says..."antiAlias" <fu bar.com> wrote in message news:cg5i6n$l3k$1 digitaldaemon.com...It might be nice to also offer a way to separate acquire/release semantics for folks who care. I can't think of a clean way to do this offhand, but perhaps: volatile(acquire) volatile(release) SeanThat's the difference between the Java/C++ and D implementation. Theformertag the variable itself, while D tags the usage. I think the D approach to the "memory-barrier" thing is the 'correct' one, but it may lead to obtuse and hard-to-find bugs. For instance, you have to manually and carefullyaddthe volatile tag to each usage, rather than the compiler doing it for you (in the Java/C++ case). D, however, gives you more flexibility and control over how/where the barrier is applied. I think that's accurate ... someone please correct me if I'm wrong.I think you've got it right.
Aug 20 2004
"Sean Kelly" <sean f4.ca> wrote in message news:cg5ran$qvc$1 digitaldaemon.com...In article <cg5jfh$lr9$1 digitaldaemon.com>, Walter says...Can we do block volatile, as in: volatile { ... } Is that even meaningful?"antiAlias" <fu bar.com> wrote in message news:cg5i6n$l3k$1 digitaldaemon.com...It might be nice to also offer a way to separate acquire/release semantics for folks who care. I can't think of a clean way to do this offhand, but perhaps: volatile(acquire) volatile(release)That's the difference between the Java/C++ and D implementation. Theformertag the variable itself, while D tags the usage. I think the D approach to the "memory-barrier" thing is the 'correct' one, but it may lead to obtuse and hard-to-find bugs. For instance, you have to manually and carefullyaddthe volatile tag to each usage, rather than the compiler doing it for you (in the Java/C++ case). D, however, gives you more flexibility and control over how/where the barrier is applied. I think that's accurate ... someone please correct me if I'm wrong.I think you've got it right.
Aug 20 2004
In article <cg5tje$sdr$3 digitaldaemon.com>, Matthew says..."Sean Kelly" <sean f4.ca> wrote in message news:cg5ran$qvc$1 digitaldaemon.com...volatile is a statement specifier, so yes. Is it meaningful? I think it could be. Memory barriers are far cheaper than locks but they aren't free. I think a volatile block would basically put an acquire barrier at the beginning of the block and a release barrier at the end. This would basically say that "this block of code can not be reordered with respect to the surrounding code" though I think the code *within* the block could still be reordered. Perhaps this last bit is something Walter could answer? For the record, I *think* this is a correct implementation of the DCLP in D: With the above, the block volatile might be useful if we wanted to do extra initialization of the singleton before assigning to s, thus replacing: with: SeanIn article <cg5jfh$lr9$1 digitaldaemon.com>, Walter says...Can we do block volatile, as in: volatile { ... } Is that even meaningful?"antiAlias" <fu bar.com> wrote in message news:cg5i6n$l3k$1 digitaldaemon.com...It might be nice to also offer a way to separate acquire/release semantics for folks who care. I can't think of a clean way to do this offhand, but perhaps: volatile(acquire) volatile(release)That's the difference between the Java/C++ and D implementation. Theformertag the variable itself, while D tags the usage. I think the D approach to the "memory-barrier" thing is the 'correct' one, but it may lead to obtuse and hard-to-find bugs. For instance, you have to manually and carefullyaddthe volatile tag to each usage, rather than the compiler doing it for you (in the Java/C++ case). D, however, gives you more flexibility and control over how/where the barrier is applied. I think that's accurate ... someone please correct me if I'm wrong.I think you've got it right.
Aug 20 2004
You'll forgive me Sean, but the double-locking 'style' was driven out of Java developers after it was shown to be mostly futile (I think it may have been Doug Lea who demonstrated that). The recommended approach over there is to construct singletons statically; which is where a 'static final' assignment would be really useful in D: static final Whatever singleton = new Whatever (...); I know you've run into this need before. For those who don't know, the D approach is thus: static Whatever singleton; static this() { singleton = new Whatever (...); } Would be nice to have the former syntactic-sugar; but I imagine it would add the same compiler complexity as static-constructors do, in terms of figuring out the interdependencies across multiple related 'static final' assignments. Which leads to a question: how does the compiler deal with circular dependencies across static-constructors? Let's try it out ... class A { static B b; static this() { printf ("A\n"); b = new B; } } class B { static A a; static this() { printf ("B\n"); a = new A; } } Note that I wouldn't recommend this as a practice to anyone, but it may occur accidentally where multiple modules are involved (I've done that with Mango). No compile errors ~ emits: A B In fact, the only obvious means to get the output in a different order is to switch the class order within the file; that is, placing B above A yields: B A Is there no dependency checking done for static constructors? Is this a bug? Am I being particularly dense today? n.b. the documentation for static constructors is apparently out-of-date. "Sean Kelly" <sean f4.ca> wrote in message news:cg5uva$t06$1 digitaldaemon.com...volatile is a statement specifier, so yes. Is it meaningful? I think itcouldbe. Memory barriers are far cheaper than locks but they aren't free. Ithink avolatile block would basically put an acquire barrier at the beginning oftheblock and a release barrier at the end. This would basically say that"thisblock of code can not be reordered with respect to the surrounding code"thoughI think the code *within* the block could still be reordered. Perhapsthis lastbit is something Walter could answer? For the record, I *think* this is a correct implementation of the DCLP inD:With the above, the block volatile might be useful if we wanted to doextrainitialization of the singleton before assigning to s, thus replacing: with: Sean
Aug 20 2004
In article <cg61nf$u96$1 digitaldaemon.com>, antiAlias says...You'll forgive me Sean, but the double-locking 'style' was driven out of Java developers after it was shown to be mostly futile (I think it may have been Doug Lea who demonstrated that).That's fine :) I mostly used it as an example beceause I had the Andrei and Scott's DDJ articles on it in front of me at the time.The recommended approach over there is to construct singletons staticallyYup. And this would work in D just as well. Since apps all begin with only one thread, eager construction seems to make far more sense than the lazy method.Which leads to a question: how does the compiler deal with circular dependencies across static-constructors? Let's try it out ... class A { static B b; static this() { printf ("A\n"); b = new B; } } class B { static A a; static this() { printf ("B\n"); a = new A; } } Note that I wouldn't recommend this as a practice to anyone, but it may occur accidentally where multiple modules are involved (I've done that with Mango). No compile errors ~ emits: A B In fact, the only obvious means to get the output in a different order is to switch the class order within the file; that is, placing B above A yields: B A Is there no dependency checking done for static constructors? Is this a bug? Am I being particularly dense today?I was wondering about this. What if A and B were in separate modules? Sean
Aug 20 2004
"Sean Kelly" <sean f4.ca> wrote in message news:cg62jg$umv$1 digitaldaemon.com...I was wondering about this. What if A and B were in separate modules?You'll get an error about circular dependencies.
Aug 22 2004
"antiAlias" <fu bar.com> wrote in message news:cg61nf$u96$1 digitaldaemon.com...You'll forgive me Sean, but the double-locking 'style' was driven out of Java developers after it was shown to be mostly futile (I think it mayhavebeen Doug Lea who demonstrated that). The recommended approach over thereisto construct singletons statically; which is where a 'static final' assignment would be really useful in D: static final Whatever singleton = new Whatever (...); I know you've run into this need before. For those who don't know, the D approach is thus: static Whatever singleton; static this() { singleton = new Whatever (...); } Would be nice to have the former syntactic-sugar; but I imagine it wouldaddthe same compiler complexity as static-constructors do, in terms offiguringout the interdependencies across multiple related 'static final' assignments. Which leads to a question: how does the compiler deal with circular dependencies across static-constructors? Let's try it out ... class A { static B b; static this() { printf ("A\n"); b = new B; } } class B { static A a; static this() { printf ("B\n"); a = new A; } } Note that I wouldn't recommend this as a practice to anyone, but it may occur accidentally where multiple modules are involved (I've done thatwithMango). No compile errors ~ emits: A B In fact, the only obvious means to get the output in a different order istoswitch the class order within the file; that is, placing B above A yields: B A Is there no dependency checking done for static constructors? Is this abug?Am I being particularly dense today?Static constructors are simply executed in the lexical order in which they appear.
Aug 22 2004
SeanWhat type is tmp? Wouldn't you get a compiler error if you don't put the type or will the compiler automatically know like with um, well I can't think of an example.
Aug 20 2004
In article <cg6bs8$1325$1 digitaldaemon.com>, Gold Dragon says...Its type is Singleton. tmp was delcared in the first line of the function as: volatile tmp = s; SeanSeanWhat type is tmp? Wouldn't you get a compiler error if you don't put the type or will the compiler automatically know like with um, well I can't think of an example.
Aug 20 2004
Sean Kelly wrote:In article <cg6bs8$1325$1 digitaldaemon.com>, Gold Dragon says...err... I meant: volatile Singleton tmp = s; SeanIts type is Singleton. tmp was delcared in the first line of the function as: volatile tmp = s;SeanWhat type is tmp? Wouldn't you get a compiler error if you don't put the type or will the compiler automatically know like with um, well I can't think of an example.
Aug 21 2004
"antiAlias" <fu bar.com> wrote in message news:cg5i6n$l3k$1 digitaldaemon.com..."Matthew" wrote ...Thanks, though I suspect it'll be more rotten plum than aplomb, but I'll do my best.I don't think we're going to be able to keep it in the same format forDTL, though. If you don't mind, I'd rather keepthe container implementations as consistent as possible, in terms oflayout, etc., so I'd be looking to reformat itconsiderably. Obviously there'll be deeper changes as well, such as templatisation, andincorporation of the composable rangetransformations/filters.Sure ... edit with aplomb <g>Question: what's the purpose of using "volatile" in various places. Since,AFAIK, D's volatile speaks to intra-threadmemory coherence, and do not cross-thread contention, aren't thesesuperfluous? Or have you come across some secretwisdom? (If so, send it to me quickly, via the secret T1!)That's the difference between the Java/C++ and D implementation. The former tag the variable itself, while D tags the usage. I think the D approach to the "memory-barrier" thing is the 'correct' one, but it may lead to obtuse and hard-to-find bugs. For instance, you have to manually and carefully add the volatile tag to each usage, rather than the compiler doing it for you (in the Java/C++ case). D, however, gives you more flexibility and control over how/where the barrier is applied. I think that's accurate ... someone please correct me if I'm wrong.Matthew "antiAlias" <fu bar.com> wrote in messagenews:cg48q9$ma$1 digitaldaemon.com...toNo problem. Just pull it out of the (browser enabled) dsource.org repository. The documentation needs a wee bit of attention :~) Let's share updates (on that module) until we get some resolution on howundereasily resolve multiple interdependent libraries ... "Matthew" <admin.hat stlsoft.dot.org> wrote in message news:cg42kq$2ubh$1 digitaldaemon.com..."antiAlias" <fu bar.com> wrote in messagenews:cg41s8$2u61$1 digitaldaemon.com...Walter" <newshound digitalmars.com> wrote in message2.0. BTW, are you following Andrei A's thread on adding lock-freeconcurrentcontainers to C++? It's a great read in comp.lang.c++.moderatedcode,thecommitteethread "Multithreaded programming: is the C++ standardizationlistening?"About time too! On that note, mango.cache has a port of Doug Lea's latest-and-greatest concurrent HashMap. Nice,clean, concise bit ofall.configurable (contention-level) and very efficient: no read-locks atcontainerAlso has foreach() support. I suggest this migrate into one of thelibs rather than slumbering quietly within Mango.We'll get that one into DTL, if you don't mind. :)
Aug 20 2004
2.0. BTW, are you following Andrei A's thread on adding lock-free concurrent containers to C++? It's a great read in comp.lang.c++.moderated under the thread "Multithreaded programming: is the C++ standardization committee listening?"Interesting. That 64-bit CAS posting I made on digitalmars.D.bugs was in support of implementing two very cool concurrent data structures "dualqueue": http://www.cs.rochester.edu/~scott/papers/2004_DISC_dual_DS.pdf "obstruction-free circular array": http://www.cs.brown.edu/people/mph/HerlihyLM03/main.pdf coming to MinTL soon...
Aug 20 2004
In article <cg4qog$8oe$1 digitaldaemon.com>, Ben Hinkle says...Neat stuff Ben. Here's something that'll help if you haven't done this already. (All apologies if you're already this up-to-speed with assembler) :) I read through both these papers, and all I could think was: boy does this algorithm "cheat"! It accomplishes lockless syncronization by exploiting the Compare-and-Swap atomic instruction that is present on Sparc workstations. That's great and all, but what about us guys on x86?!? Well, I did some sniffng around and dug up the "cmpxchg" ASM instruction. http://members.tripod.com/~oldboard/assembly/cmpxchg.html A concrete use of the instruction (see "compare_and_swap" function): http://www.cs.cornell.edu/courses/cs414/2001SP/minithread_md.c This should make your implementation a little easier to write. - Pragma2.0. BTW, are you following Andrei A's thread on adding lock-free concurrent containers to C++? It's a great read in comp.lang.c++.moderated under the thread "Multithreaded programming: is the C++ standardization committee listening?"Interesting. That 64-bit CAS posting I made on digitalmars.D.bugs was in support of implementing two very cool concurrent data structures "dualqueue": http://www.cs.rochester.edu/~scott/papers/2004_DISC_dual_DS.pdf "obstruction-free circular array": http://www.cs.brown.edu/people/mph/HerlihyLM03/main.pdf coming to MinTL soon...
Aug 20 2004
"pragma" <EricAnderton at yahoo dot compragma_member pathlink.com> wrote in message news:cg5dhk$i4c$1 digitaldaemon.com...In article <cg4qog$8oe$1 digitaldaemon.com>, Ben Hinkle says...comp.lang.c++.moderated2.0. BTW, are you following Andrei A's thread on adding lock-free concurrent containers to C++? It's a great read inalready.Neat stuff Ben. Here's something that'll help if you haven't done thisunder the thread "Multithreaded programming: is the C++ standardization committee listening?"Interesting. That 64-bit CAS posting I made on digitalmars.D.bugs was in support of implementing two very cool concurrent data structures "dualqueue": http://www.cs.rochester.edu/~scott/papers/2004_DISC_dual_DS.pdf "obstruction-free circular array": http://www.cs.brown.edu/people/mph/HerlihyLM03/main.pdf coming to MinTL soon...(All apologies if you're already this up-to-speed with assembler) :) I read through both these papers, and all I could think was: boy does this algorithm "cheat"! It accomplishes lockless syncronization by exploitingtheCompare-and-Swap atomic instruction that is present on Sparc workstations. That's great and all, but what about us guys on x86?!? Well, I did somesniffngaround and dug up the "cmpxchg" ASM instruction. http://members.tripod.com/~oldboard/assembly/cmpxchg.html A concrete use of the instruction (see "compare_and_swap" function): http://www.cs.cornell.edu/courses/cs414/2001SP/minithread_md.c This should make your implementation a little easier to write. - PragmaYeah - it seems like the two work-horses of the latest concurrent research are cmpxchg and cmpxchg8b (or whatever the equivalent is on a particular processor). There are some pretty nasty hacks around memory management, though, in one of those papers. It maintains a thread-specific heap by aligning the bottom of the stack and whacking off the bottom bits of the stack pointer whenever it needs to start looking for a free node. Talk about cheating!
Aug 20 2004
Walter wrote:Lots more bug fixes. Added special 'length' inside array [ ]'s. http://www.digitalmars.com/d/changelog.htmlWalter, have you got std.loader compiled into phobos on linux?
Aug 19 2004
"clayasaurus" <clayasaurus gmail.com> wrote in message news:cg3vc7$2t8d$1 digitaldaemon.com...Walter wrote:Good question. btw, I'm going to bite the bullet next week and revisit std.loader. I don't know whether I can resurrect it from its current ignominy, or whether a total reimplementation (keeping interface, of course, if at all poss) will be called for. I do know that it's had lots of complaints and that, even though it was born out of wedlock, I still need to take my responsibilities seriously. Colin the Code CassanovaLots more bug fixes. Added special 'length' inside array [ ]'s. http://www.digitalmars.com/d/changelog.htmlWalter, have you got std.loader compiled into phobos on linux?
Aug 19 2004
Matthew wrote:"clayasaurus" <clayasaurus gmail.com> wrote in message news:cg3vc7$2t8d$1 digitaldaemon.com...Hey Matthew I think std.loader is a nice piece of code and was complaining about it because I didn't know about -ldl. Oh yes and having it be compiled into phobos on linux would be nice too. *cheers*Walter wrote:Good question. btw, I'm going to bite the bullet next week and revisit std.loader. I don't know whether I can resurrect it from its current ignominy, or whether a total reimplementation (keeping interface, of course, if at all poss) will be called for. I do know that it's had lots of complaints and that, even though it was born out of wedlock, I still need to take my responsibilities seriously. Colin the Code CassanovaLots more bug fixes. Added special 'length' inside array [ ]'s. http://www.digitalmars.com/d/changelog.htmlWalter, have you got std.loader compiled into phobos on linux?
Aug 20 2004
Matthew wrote:"clayasaurus" <clayasaurus gmail.com> wrote in message news:cg3vc7$2t8d$1 digitaldaemon.com...I just checked and loader.o is still missing from libphobos.a on linux. Surely it would only take a few seconds of Walter's time to add it? Just change version(Linux) to version(linux).Walter wrote:Good question. btw, I'm going to bite the bullet next week and revisit std.loader. I don't know whether I can resurrect it from its current ignominy, or whether a total reimplementation (keeping interface, of course, if at all poss) will be called for. I do know that it's had lots of complaints and that, even though it was born out of wedlock, I still need to take my responsibilities seriously. Colin the Code CassanovaLots more bug fixes. Added special 'length' inside array [ ]'s. http://www.digitalmars.com/d/changelog.htmlWalter, have you got std.loader compiled into phobos on linux?
Aug 20 2004
"clayasaurus" <clayasaurus gmail.com> wrote in message news:cg4t06$9ns$2 digitaldaemon.com...Matthew wrote:for."clayasaurus" <clayasaurus gmail.com> wrote in message news:cg3vc7$2t8d$1 digitaldaemon.com...Walter wrote:Good question. btw, I'm going to bite the bullet next week and revisit std.loader. I don't know whether I can resurrect it from its current ignominy, or whether a total reimplementation (keeping interface, of course, if at all poss) will be calledLots more bug fixes. Added special 'length' inside array [ ]'s. http://www.digitalmars.com/d/changelog.htmlWalter, have you got std.loader compiled into phobos on linux?Indeed. Let's hope he does so. :-)I do know that it's had lots of complaints and that, even though it was born out of wedlock, I still need to take my responsibilities seriously. Colin the Code CassanovaI just checked and loader.o is still missing from libphobos.a on linux. Surely it would only take a few seconds of Walter's time to add it? Just change version(Linux) to version(linux).
Aug 20 2004
Walter wrote: Added special 'length' inside array [ ]'s. Yay!
Aug 20 2004
In article <cg3n60$2oap$1 digitaldaemon.com>, Walter says...Lots more bug fixes. Added special 'length' inside array [ ]'s. http://www.digitalmars.com/d/changelog.htmlWalter: Thxs a lot for adding in the ifind() and irfind() functions into the std.string...I'll be putting them to good use! :)) Also, will you be adding in the ireplace() and icount() as well? I wrote them up and put them in a link just below ifind() functions back in mid-june, I'm not sure if you want me to resubmit them or not. ------------------------------------------------------------------- "Dare to reach for the Stars...Dare to Dream, Build, and Achieve!"
Aug 20 2004