Can the GC suspend a managed thread executing native code?

  • Thread starter Thread starter Jon
  • Start date Start date
J

Jon

My question is:
Can the Garbage Collector (GC) suspended a managed thread while it is executing native code.

The reason I am interested in this is that I have:
1) a native thread (N) that only executes native code,
2) a managed thread (M) that sometimes executes native code,
3) a critical section, that is shared by the native code portions of N & M.

And I what to know: Can N be suspend by the GC?
This would be true if the GC could suspended M while it executing natively inside the critical section.
 
Can the Garbage Collector (GC) suspended a managed thread while it is executing native code.

The reason I am interested in this is that I have:
1) a native thread (N) that only executes native code,
2) a managed thread (M) that sometimes executes native code,
3) a critical section, that is shared by the native code portions of N & M.

And I what to know: Can N be suspend by the GC?
This would be true if the GC could suspended M while it executing natively inside the critical section.

AFAIK managed threads are not suspended while they are executing native code
(they will be suspended only when they return to managed)

Regards,
Oleg
[VC++ MVP http://www.debuginfo.com/]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top