www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - multithreading profiling

reply jj75607 <jj75607 gmail.com> writes:
Hello!

Is it possible to start profiling on multithreaded app with Dmd?

https://issues.dlang.org/show_bug.cgi?id=14511 is open. I am 
doing wrong or why this program segfaults if compiled with 
profiler hooks?

import core.atomic;

shared struct S
{	
	uint counter;

	bool inc() shared
	{
		atomicOp!("+=")(counter, 1);
		return true;
	}
}

int main(string[] argv)
{
	S s;

	return 0;
}

Thank you!
Apr 18 2016
next sibling parent reply Marc =?UTF-8?B?U2Now7x0eg==?= <schuetzm gmx.net> writes:
Which platform/OS, dmd version, and command line are you using?
Apr 18 2016
parent jj75607 <jj75607 gmail.com> writes:
On Monday, 18 April 2016 at 13:45:20 UTC, Marc Schütz wrote:
 Which platform/OS, dmd version, and command line are you using?
Windows7, DMD 2.071.0, run from Visual Studio 2013 Community + VisualD 0.3.43
Apr 18 2016
prev sibling parent tcak <1ltkrs+3wyh1ow7kzn1k sharklasers.com> writes:
On Monday, 18 April 2016 at 13:33:20 UTC, jj75607 wrote:
 Hello!

 Is it possible to start profiling on multithreaded app with Dmd?

 https://issues.dlang.org/show_bug.cgi?id=14511 is open. I am 
 doing wrong or why this program segfaults if compiled with 
 profiler hooks?

 import core.atomic;

 shared struct S
 {	
 	uint counter;

 	bool inc() shared
 	{
 		atomicOp!("+=")(counter, 1);
 		return true;
 	}
 }

 int main(string[] argv)
 {
 	S s;

 	return 0;
 }

 Thank you!
As far as I know, profiling system doesn't work on multithreading programs correctly. At least, it has never worked for me. While closing the program, it creates problem always. But in a signle threaded environment, no problem.
Apr 18 2016