Click here to Skip to main content
16,004,778 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
As is mentioned in the title, I wonder how to monitor the interleaving for concurrent program. For C#, I have tried to use profiling API to instrumentate a concurrent program, to get its run trace. But after thinking for a while, it cannot work, because the injecting statement is also in concurrent scheduling, which cannot reflect the real run trace.For example, proram foo is a concurrent function:
<br />
function foo()<br />
{<br />
statement a;<br />
statement b;<br />
}<br />

after instrumentation, the function should be:
<br />
function foo_instr()<br />
{<br />
inserting statement;// get the running statement and its thread ID<br />
statement a;<br />
insterting statement;<br />
statement b;<br />
}


Supposing there is 2 threads running, I want to get a trace like: thread_1 a -> thread_2 a -> thread_2 b -> thread_1 b. But using the instrumentation method, I find I cannot get the correct run trace, as the inserting statement is also in concurrent program as well. So how can I handle it?

Additional, is there way to analysis the shared memory access between thread? So I can just log the shared memory access trace.

Appreciating for your answers.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900