Carsten Harnisch | 10 Oct 10:27
Favicon

Please advise. Threading in unmanaged code


This is my first post, but I already need some experts advise :)

We are evaluating to port an existing app (written in c/c++, for
LINUX/Windows/Mac) to mono. The basic pattern is a daemon-based system
(using pthreads, epoll) that will dispatch data to various embedded
scripting engines (PHP, Tcl, Perl, etc.). Currently the engines will have
one-time startup and shutdown methods and the system will pre-create
numerous threads. The daemon will then notify the workers to do their work.

In the planed scenario the daemon should be written in mono whereas the
scripting-engines needs to have unmanaged wrappers.

As I understood mono is using phreads and epoll, so having created a
"mono"-thread and using this thread to call an unmanged piece of code, will
this unmanaged code be run in the context of the underlaying pthread? Or
does the mono i/o layer call the unmanaged code with its own thread pool?

thx for you help

Carsten Harnisch
--

-- 
View this message in context: http://www.nabble.com/Please-advise.-Threading-in-unmanaged-code-tp19914089p19914089.html
Sent from the Mono - Dev mailing list archive at Nabble.com.
Paolo Molaro | 10 Oct 22:51

Re: Please advise. Threading in unmanaged code

On 10/10/08 Carsten Harnisch wrote:
> As I understood mono is using phreads and epoll, so having created a
> "mono"-thread and using this thread to call an unmanged piece of code, will
> this unmanaged code be run in the context of the underlaying pthread? Or
> does the mono i/o layer call the unmanaged code with its own thread pool?

The call will happen in the same thread.

lupus

--

-- 
-----------------------------------------------------------------
lupus <at> debian.org                                     debian/rules
lupus <at> ximian.com                             Monkeys do it better

Gmane