Re: Synchronize Class fields between different threads

2017-11-10 Thread crimaniak via Digitalmars-d-learn
On Friday, 10 November 2017 at 14:36:03 UTC, DrCataclysm wrote: It is working now. The problem was that the debugger in eclipse ddt seems to completely broken. If i run it directly from bash it is working. Be careful with such statements. Typically, this situation means that there are Heisen

Re: How you guys go about -BetterC Multithreading?

2017-11-10 Thread Jacob Carlborg via Digitalmars-d-learn
On 2017-11-10 14:30, Petar Kirov [ZombineDev] wrote: static constructors Yeah, those won't work. I don't think that's really related to TLS, hence my confusion. -- /Jacob Carlborg

Re: Synchronize Class fields between different threads

2017-11-10 Thread bauss via Digitalmars-d-learn
On Friday, 10 November 2017 at 14:36:03 UTC, DrCataclysm wrote: On Friday, 10 November 2017 at 14:27:41 UTC, bauss wrote: On Friday, 10 November 2017 at 14:13:26 UTC, DrCataclysm wrote: On Friday, 10 November 2017 at 13:50:56 UTC, rikki cattermole wrote: Remember this bit: Everything on the hea

Re: Synchronize Class fields between different threads

2017-11-10 Thread bauss via Digitalmars-d-learn
On Friday, 10 November 2017 at 15:01:30 UTC, bauss wrote: On Friday, 10 November 2017 at 14:36:03 UTC, DrCataclysm wrote: On Friday, 10 November 2017 at 14:27:41 UTC, bauss wrote: On Friday, 10 November 2017 at 14:13:26 UTC, DrCataclysm wrote: [...] _client is allocated in the heap. Socket

Re: How to specify 64 bit architecture in dub configuration file?

2017-11-10 Thread Atila Neves via Digitalmars-d-learn
On Friday, 10 November 2017 at 09:18:34 UTC, Nicholas Wilson wrote: On Friday, 10 November 2017 at 08:30:39 UTC, OlaOst wrote: Using 'dub --arch=x86_64' will get you a 64 bit build, but is it possible to specify 64 bit architecture in the configuration file, so one can just type 'dub' and get a

Re: Synchronize Class fields between different threads

2017-11-10 Thread DrCataclysm via Digitalmars-d-learn
On Friday, 10 November 2017 at 14:27:41 UTC, bauss wrote: On Friday, 10 November 2017 at 14:13:26 UTC, DrCataclysm wrote: On Friday, 10 November 2017 at 13:50:56 UTC, rikki cattermole wrote: Remember this bit: Everything on the heap, is not thread-local, it is global. This includes everything i

Re: Synchronize Class fields between different threads

2017-11-10 Thread bauss via Digitalmars-d-learn
On Friday, 10 November 2017 at 14:13:26 UTC, DrCataclysm wrote: On Friday, 10 November 2017 at 13:50:56 UTC, rikki cattermole wrote: Remember this bit: Everything on the heap, is not thread-local, it is global. This includes everything inside a class. When you synchronize (statement) it is lo

Re: Synchronize Class fields between different threads

2017-11-10 Thread rikki cattermole via Digitalmars-d-learn
On 10/11/2017 2:13 PM, DrCataclysm wrote: On Friday, 10 November 2017 at 13:50:56 UTC, rikki cattermole wrote: Remember this bit: Everything on the heap, is not thread-local, it is global. This includes everything inside a class. When you synchronize (statement) it is locking and then unlockin

Re: Synchronize Class fields between different threads

2017-11-10 Thread DrCataclysm via Digitalmars-d-learn
On Friday, 10 November 2017 at 13:50:56 UTC, rikki cattermole wrote: Remember this bit: Everything on the heap, is not thread-local, it is global. This includes everything inside a class. When you synchronize (statement) it is locking and then unlocking a mutex. A class has a mutex, simple! It

Re: Synchronize Class fields between different threads

2017-11-10 Thread rikki cattermole via Digitalmars-d-learn
Remember this bit: Everything on the heap, is not thread-local, it is global. This includes everything inside a class. When you synchronize (statement) it is locking and then unlocking a mutex. A class has a mutex, simple! It only prevent multiple threads modifying a single thing at specific t

Re: How you guys go about -BetterC Multithreading?

2017-11-10 Thread Petar via Digitalmars-d-learn
On Thursday, 9 November 2017 at 19:42:55 UTC, Jacob Carlborg wrote: On 2017-11-09 17:52, Petar Kirov [ZombineDev] wrote: Thanks for reminding me, I keep forgetting that it should just work (minus initialization?). What do you mean "initialization"? static constructors

Re: How you guys go about -BetterC Multithreading?

2017-11-10 Thread Petar via Digitalmars-d-learn
On Friday, 10 November 2017 at 11:55:57 UTC, Guillaume Piolat wrote: On Thursday, 9 November 2017 at 16:00:36 UTC, Petar Kirov [ZombineDev] wrote: In short, the cost / benefit of going all the way version(D_BetterC) is incredibly poor for regular applications, as you end up a bit more limited

Synchronize Class fields between different threads

2017-11-10 Thread DrCataclysm via Digitalmars-d-learn
I am trying to understand concurrent/parallel programming with D but i just don't get how i should usesome of the concepts. This is the code i am using to tying out stuff. public class TCPListener { ubyte[] _messageBuffer; Socket _server; Socket _client; // define server in con

Re: How you guys go about -BetterC Multithreading?

2017-11-10 Thread Guillaume Piolat via Digitalmars-d-learn
On Thursday, 9 November 2017 at 16:00:36 UTC, Petar Kirov [ZombineDev] wrote: In short, the cost / benefit of going all the way version(D_BetterC) is incredibly poor for regular applications, as you end up a bit more limited than with modern C++ (> 11) for prototyping. For example, even write

Re: LDC Intrinsics

2017-11-10 Thread Nicholas Wilson via Digitalmars-d-learn
On Friday, 10 November 2017 at 09:33:17 UTC, Nordlöw wrote: What kinds of intrinsics are explicitly available to the developer when compiling with LDC? And are there any docs? there are some pragmas for bitop stuff. https://github.com/ldc-developers/ldc/blob/master/gen/pragma.cpp#L59 there a

Re: ddox empty public methods/interfaces etc

2017-11-10 Thread RazvanN via Digitalmars-d-learn
On Thursday, 9 November 2017 at 14:21:52 UTC, Steven Schveighoffer wrote: On 11/8/17 10:45 PM, Andrey wrote: I just added to dub.json this: "-ddoxFilterArgs": [     "--min-protection=Public" ] i.e. without --only-documented option, in this way ddox will generate documentation for all publi

LDC Intrinsics

2017-11-10 Thread Nordlöw via Digitalmars-d-learn
What kinds of intrinsics are explicitly available to the developer when compiling with LDC? And are there any docs?

Re: How to specify 64 bit architecture in dub configuration file?

2017-11-10 Thread Nicholas Wilson via Digitalmars-d-learn
On Friday, 10 November 2017 at 08:30:39 UTC, OlaOst wrote: Using 'dub --arch=x86_64' will get you a 64 bit build, but is it possible to specify 64 bit architecture in the configuration file, so one can just type 'dub' and get a 64 bit build? "dflags" : "-m64" will work. You can probably use a

How to specify 64 bit architecture in dub configuration file?

2017-11-10 Thread OlaOst via Digitalmars-d-learn
Using 'dub --arch=x86_64' will get you a 64 bit build, but is it possible to specify 64 bit architecture in the configuration file, so one can just type 'dub' and get a 64 bit build?