Re: Garbage collector is able to interrupt a native function?
- From: "Chris Tacke, eMVP" <ctacke.at.opennetcf.dot.com>
- Date: Wed, 4 Jun 2008 09:37:12 -0500
No. The GC cannot interrupt the native call. The GC may run as soon as
executin returns across the P/Invoke boundary, so before your code gets any
return value, but the P/Invoke will run to completion.
--
Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com
"Frankie D." <FrankieD@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:29F91DA4-111A-4796-8539-B3B5F2F42ED2@xxxxxxxxxxxxxxxx
Hi,
There are two projects in my VS2005 solution: a managed and a native.
First
one written in C# is responsible for user interface, the second one
written
in C++ is responsible for real-time functionality.
They communicate each other using platform invoke. For example
MyCSharpFunc() calls MyNativeFunc().
MyNativeFunc() waits for a mutex, does some work and releases the mutex.
While this short work my real time thread is waiting for MyNativeFunc().
Garbage collector is able to interrupt MyNativeFunc()???
(Because MyNativeFunc() is called from a managed function)
Please help! Thanks in advance.
Frankie
.
- Follow-Ups:
- Re: Garbage collector is able to interrupt a native function?
- From: Mai Kee Reiss
- Re: Garbage collector is able to interrupt a native function?
- Prev by Date: Re: C++ dlls not loading with WM 6, worked with WM5.0
- Next by Date: Re: Serial Communications documentation
- Previous by thread: Re: C++ dlls not loading with WM 6, worked with WM5.0
- Next by thread: Re: Garbage collector is able to interrupt a native function?
- Index(es):
Relevant Pages
|