Threads, shread and TLS

2011-01-07 Thread Adam Conner-Sax
So, I thought I sort of understood "shared" and now I think I don't. If I have a class: class foo { int x; static int y; shared static int z; } So x is one instance per class and is thread-local? y is one instance per thread? z is one instance per application, i.e., global? If that's tru

Re: Threads, shread and TLS

2011-01-07 Thread Adam Conner-Sax
== Quote from Adam Conner-Sax (adam_conner_...@yahoo.com)'s article > So, I thought I sort of understood "shared" and now I think I don't. > If I have a class: > class foo { > int x; > static int y; > shared static int z; > } > So x is one instan

Re: Threads, shread and TLS

2011-01-07 Thread Adam Conner-Sax
does not have storage class "shared"? Yes, that confuses me too. Should it be an error? I have never dealt with bugzilla but I will try to figure out how to do what you ask :) Thanks again. Adam == Quote from Steven Schveighoffer (schvei...@yahoo.com)'s article > On Fri,

sort and shared

2011-01-20 Thread Adam Conner-Sax
The following code: import std.algorithm; class Foo { private: int id_; public: shared int id() const { return id_; } } static bool compare(in shared(Foo) a, in shared(Foo) b) { return (a.id() < b.id()); } void main() { shared Foo a,b,c; shared(Foo)[] uFooArray = [a,b,c]; sort!(co

Re: sort and shared

2011-01-21 Thread Adam Conner-Sax
Thanks! I tried to apply that patch and rebuild phobos (I changed the file, remade libphobos2.a, put it in /usr/local/lib). That worked but I still get my error. I might have done the applying or rebuilding wrong though, especially since once I did that, even with the casting away of shared, I g

Re: sort and shared

2011-01-23 Thread Adam Conner-Sax
Thanks. I'll wait for now since (gulp!) casting away shared just for the sort works and I'm not sure what I'm doing wrong with the patching. Adam

std.concurrency, speed, etc. (part 2)

2011-02-04 Thread Adam Conner-Sax
attaching more files... begin 644 PrettyPrint.d M:6UP;W)T('-T9"YF;W)M870[#0II;7!O7!E8V]N&-E<'1I;VX[#0II;7!OTPL0RQ2?0T*#0H-"G-TPT*("!A=71O(&$@/2!A<'!E;F1E2!J=7-T:69Y+"`-"@D)"2`@("!I;B!S M=')I;F=;72!F;W)M871S+"!I;B!4(&%R9W,I#0I[#0H@(&5N9F]R8V4H8V]L M=6UN7W=I9'1H3L-"B`@5M=(&IUPT* M("`@(&$N<'5T*&9O5MK7

Re: std.concurrency, speed, etc.

2011-02-04 Thread Adam Conner-Sax
== Quote from Sean Kelly (s...@invisibleduck.org)'s article > Adam Conner-Sax Wrote: > > > > 1) I couldn't get the synchronized class version (as opposed to using > > synchronized statements in the functions) to run. It would hang in odd > > ways. > &g