<table cellspacing='0' cellpadding='0' border='0' ><tr><td valign='top' style='font: inherit;'><P>Sander,</P>
<P> </P>
<P>Thanks, I understand it. For each vm system thread that waits for directory change </P>
<P>events, we can launch a host thread. </P>
<P> </P>
<P>Another way is not to use the vbox mechanism, instead, using tcp/ip communication between host and vm, but this won't work if networking is disabled. This is how the current windows sharing (samba) are implemented.</P>
<P> </P>
<P>Huihong</P>
<P><BR>--- On <B>Tue, 7/15/08, Sander van Leeuwen <I><Sander.Vanleeuwen@Sun.COM></I></B> wrote:<BR></P>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(16,16,255) 2px solid">From: Sander van Leeuwen <Sander.Vanleeuwen@Sun.COM><BR>Subject: Re: [vbox-dev] host calling into vm for async I/O?<BR>To: "VirtualBox developer's list" <vbox-dev@virtualbox.org><BR>Cc: huisinro@yahoo.com<BR>Date: Tuesday, July 15, 2008, 1:15 AM<BR><BR>
<DIV id=yiv538608446>Let me clarify this a bit more on the blocking case. Inside the guest you need to create a (kernel) thread that calls the host HGCM service and waits for an answer, which it will get when the host service detects a directory change. As the host service is single threaded, you need to create a separate thread that monitors for directory changes. That additional host thread will asynchronously complete the HGCM service call the guest makes. <BR>This means the HGCM service call made by the guest is not completed inside the svcCall handler (by calling g_pHelpers->pfnCallComplete).<BR><BR>Sander<BR><BR>Sander van Leeuwen wrote: 
<BLOCKQUOTE type="cite">There's is no such reversed callback mechanism for HGCM. You'd either have to poll or make a guest thread block in a wait for directory change HGCM call. The latter<BR>is not that easy as an HGCM client is single threaded.<BR><BR>Sander<BR><BR><BR>Huihong Luo wrote: 
<BLOCKQUOTE type="cite">
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD style="FONT-FAMILY: inherit; font-size-adjust: inherit; font-stretch: inherit" vAlign=top>
<P>Are there any APIs that can invoke vm's functions from host (opposite to <FONT size=2>VbglHGCMCall which does vm to host calls)?</FONT><BR></P>
<P>I am trying to implement directory change notification features on windows shared folders. Basically, when files change in a host folder, I want the host to invoke a callback function inside vm.</P>
<P> </P>
<P>Thanks,</P>
<P> </P>
<P>Huihong<BR></P></TD></TR></TBODY></TABLE><PRE><HR width="90%" SIZE=4>
_______________________________________________
vbox-dev mailing list
<A class=moz-txt-link-abbreviated href="mailto:vbox-dev@virtualbox.org" target=_blank rel=nofollow>vbox-dev@virtualbox.org</A>
<A class=moz-txt-link-freetext href="http://vbox.innotek.de/mailman/listinfo/vbox-dev" target=_blank rel=nofollow>http://vbox.innotek.de/mailman/listinfo/vbox-dev</A>
  </PRE></BLOCKQUOTE><BR><BR><PRE class=moz-signature>-- 
Kind regards / Mit freundlichen Gruessen / Met vriendelijke groet

--

Sun Microsystems GmbH        Sander van Leeuwen
Werkstrasse 24               Senior Staff Engineer, VirtualBox
71384 Weinstadt, Germany     <A class=moz-txt-link-freetext href="mailto:Sander.Vanleeuwen@sun.com" target=_blank rel=nofollow>mailto:Sander.Vanleeuwen@sun.com</A>


================================================
Sitz der Gesellschaft: Sun Microsystems GmbH,
Sonnenallee 1, 85551 Kirchheim-Heimstetten
Amtsgericht Muenchen: HRB 161028
Geschaeftsfuehrer: Thomas Schroeder,
Wolfgang Engels, Dr. Roland Boehmer
Vorsitzender des Aufsichtsrates: Martin Haering
================================================</PRE><PRE><HR width="90%" SIZE=4>
_______________________________________________
vbox-dev mailing list
<A class=moz-txt-link-abbreviated href="mailto:vbox-dev@virtualbox.org" target=_blank rel=nofollow>vbox-dev@virtualbox.org</A>
<A class=moz-txt-link-freetext href="http://vbox.innotek.de/mailman/listinfo/vbox-dev" target=_blank rel=nofollow>http://vbox.innotek.de/mailman/listinfo/vbox-dev</A>
  </PRE></BLOCKQUOTE><BR><BR><PRE class=moz-signature>-- 
Kind regards / Mit freundlichen Gruessen / Met vriendelijke groet

--

Sun Microsystems GmbH        Sander van Leeuwen
Werkstrasse 24               Senior Staff Engineer, VirtualBox
71384 Weinstadt, Germany     <A class=moz-txt-link-freetext href="mailto:Sander.Vanleeuwen@sun.com" target=_blank rel=nofollow>mailto:Sander.Vanleeuwen@sun.com</A>


================================================
Sitz der Gesellschaft: Sun Microsystems GmbH,
Sonnenallee 1, 85551 Kirchheim-Heimstetten
Amtsgericht Muenchen: HRB 161028
Geschaeftsfuehrer: Thomas Schroeder,
Wolfgang Engels, Dr. Roland Boehmer
Vorsitzender des Aufsichtsrates: Martin Haering
================================================</PRE></DIV></BLOCKQUOTE></td></tr></table>