Re: new(malloc) locks everything in multithreading

2014-10-24 Thread tcak via Digitalmars-d-learn
On Friday, 24 October 2014 at 10:29:10 UTC, Kagamin wrote: Looks like your IDE filters too much. Can you configure it to filter less and show address locations? This is what I have found: Main Thread http://i.imgur.com/6ElZ3Fm.png Second Thread (TestThread) http://i.imgur.com/w4y5gYB.png

Re: new(malloc) locks everything in multithreading

2014-10-24 Thread tcak via Digitalmars-d-learn
On Friday, 24 October 2014 at 12:38:48 UTC, Kagamin wrote: On Friday, 24 October 2014 at 10:46:57 UTC, tcak wrote: Second Thread (TestThread) http://i.imgur.com/w4y5gYB.png Hmm... where is __lll_lock_wait_private now? And how mmap can hang at all? Here it is. http://i.imgur.com/5ZDuYRF.png

Re: new(malloc) locks everything in multithreading

2014-10-24 Thread tcak via Digitalmars-d-learn
On Friday, 24 October 2014 at 16:51:02 UTC, Kapps wrote: On Friday, 24 October 2014 at 10:49:42 UTC, tcak wrote: Not sure if this is the same issue, but by default gdb breaks on signals that the GC uses, which would explain why it's breaking in gdb but not normally. What happens if you try:

Re: new(malloc) locks everything in multithreading

2014-10-24 Thread tcak via Digitalmars-d-learn
On Friday, 24 October 2014 at 21:02:05 UTC, Kapps wrote: On Friday, 24 October 2014 at 18:38:39 UTC, tcak wrote: On Friday, 24 October 2014 at 16:51:02 UTC, Kapps wrote: This is what I did on shell: (I put some spaces for readability) tolga@tolga:~/dev/d/bug$ dmd -gc -debug test.d

std.stdio breaks casting operation

2014-10-23 Thread tcak via Digitalmars-d-learn
The main function has following: - main.d - import test; auto t = new shared test.Test(); auto sock = new std.socket.TcpSocket( std.socket.AddressFamily.INET6 ); t.setIt( sock ); - test.d - module test; import std.socket; public class Test{ private

new(malloc) locks everything in multithreading

2014-10-23 Thread tcak via Digitalmars-d-learn
This must be my special day that everything I try gets broken. import core.thread; import std.stdio; class ThreadTest{ private core.thread.Thread th; public this() shared{ th = cast( shared )( new core.thread.Thread(

Assignment to enumerated string, is content copied or array information?

2014-10-18 Thread tcak via Digitalmars-d-learn
enum Values: string{ NONE = , Value1 = Apple, Value2 = Peach, Value3 = Lemon } Values lastHeldValue = Value3; Is the lastHeldValue just pointer + length information, and it points to Lemon; or is Lemon copied to another place in memory? I am doing comparison as if( lastHeldValue ==

Mixin template functions are ignored in struct

2014-10-14 Thread tcak via Digitalmars-d-learn
I have written a struct and a mixin template, and that mixin template is mixed into that struct as follows. private mixin template TestCommonMethods(){ public bool apply( int d, int e ){ return false; } } public struct Test{ public mixin

Re: Mixin template functions are ignored in struct

2014-10-14 Thread tcak via Digitalmars-d-learn
On Tuesday, 14 October 2014 at 21:10:02 UTC, anonymous wrote: On Tuesday, 14 October 2014 at 20:58:19 UTC, tcak wrote: I have written a struct and a mixin template, and that mixin template is mixed into that struct as follows. private mixin template TestCommonMethods(){ public bool

Re: How do you get T from shared(T) ?

2014-09-28 Thread tcak via Digitalmars-d-learn
On Sunday, 28 September 2014 at 09:11:07 UTC, Marco Leise wrote: For head-unshared there is `static if (is(T U : shared U))`. But how do you get the unshared type for anything from `shared void*` to `shared uint` ? shared int a; int b = cast()a;

<    1   2   3