Re: Correct place to catch SIGXCPU
Rodrigo Kumpera <[email protected]> Sun, 3 Apr 2011 21:36:18 +0000
| Newsgroups | gmane.comp.gnome.mono.garbage-collection |
|---|---|
| Message-ID | <[email protected]> |
--===============0820131594== Content-Type: multipart/alternative; boundary=90e6ba181850fc650504a00a6eec --90e6ba181850fc650504a00a6eec Content-Type: text/plain; charset=ISO-8859-1 SIGXCPU is used by both mono GC's to restart a stopped thread. The pattern is the following: //stop a thread, collect its register and wait for restart signal pthread_kill (thread, SIGPWR) //restart a thread pthread_kill (thread, SIGXCPU) The signal handler for sigpwr uses sigsuspend to block until it is signaled to resume. You can see this in mono/metadata/sgen-gc.c suspend_handler and libgc/pthread_stop_world.c _GC_suspend_handler. Both use the same pattern to restart. If sigsuspend is no good on your host, it can be easily changed to use a semaphore instead. Cheers, Rodrigo On Sun, Apr 3, 2011 at 7:03 PM, Maik Greubel <[email protected]> wrote: > Hello list, > > I've got a problem regarding the SIGXCPU signal raised obviously by garbage > collector, which is described here: > http://www.mono-project.com/Embedding_Mono > > First let me explain what I have did (I have no X11 or X.org installed): > > - Compile & install DirectFB (git version) > - Compile and install gtk+ 2.24 against DirectFB > - Compile several libraries needed by mono & gtk-sharp (both latest stable) > - Compile and install webkit > - Compile and install webkit-sharp > - Create a simple C# application which makes use of the webkit-sharp > - Run it using mono > > The application exits using SIGXCPU and writes "CPU time limit exceeded." > to > console. gdb does not really help here. I can provide all traces needed to > find a solution for that. > > I strongly believe, it has something to do with my architecture and has > nothing to do with mono itself or any of the used components. A test with > GtkHTML patched into gtk-sharp gives the same result. > > Where is the correct place to catch that SIGXCPU and provide the signal > back > to app so my application is able to run? > > When the time has come and my application runs well I want to contribute > all > of my patches to the several projects. > > Thanks and regards > > Maik > > _______________________________________________ > Mono-gc-list maillist - [email protected] > http://lists.ximian.com/mailman/listinfo/mono-gc-list > --90e6ba181850fc650504a00a6eec Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable <meta charset=3D"utf-8">SIGXCPU is used by both mono GC's to restart a = stopped thread.<div><br></div><div>The pattern is the following:</div><div>= <br></div><div>//stop a thread, collect its register and wait for restart s= ignal</div> <div>pthread_kill (thread,=A0SIGPWR)</div><div><br></div><div>//restart a t= hread</div><div><meta charset=3D"utf-8"><div>pthread_kill (thread,=A0<meta = charset=3D"utf-8">SIGXCPU)</div><div><br></div><div>The signal handler for = sigpwr uses=A0sigsuspend to block until it is signaled to resume.</div> <div>You can see this in mono/metadata/sgen-gc.c suspend_handler and</div><= div>libgc/pthread_stop_world.c=A0_GC_suspend_handler.</div><div><br></div><= div>Both use the same pattern to restart.</div><div><br></div><div>If=A0sig= suspend is no good on your host, it can be=A0=A0easily=A0changed to use a s= emaphore instead.</div> <meta charset=3D"utf-8"><meta charset=3D"utf-8"><div><br></div><div>Cheers,= </div><div>Rodrigo</div><div><br></div><br><div class=3D"gmail_quote">On Su= n, Apr 3, 2011 at 7:03 PM, Maik Greubel <span dir=3D"ltr"><<a href=3D"ma= ilto:[email protected]">[email protected]</a>></span> wrote:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex;">Hello list,<br> <br> I've got a problem regarding the SIGXCPU signal raised obviously by gar= bage<br> collector, which is described here:<br> <a href=3D"http://www.mono-project.com/Embedding_Mono" target=3D"_blank">ht= tp://www.mono-project.com/Embedding_Mono</a><br> <br> First let me explain what I have did (I have no X11 or X.org installed):<br= > <br> - Compile & install DirectFB (git version)<br> - Compile and install gtk+ 2.24 against DirectFB<br> - Compile several libraries needed by mono & gtk-sharp (both latest sta= ble)<br> - Compile and install webkit<br> - Compile and install webkit-sharp<br> - Create a simple C# application which makes use of the webkit-sharp<br> - Run it using mono<br> <br> The application exits using SIGXCPU and writes "CPU time limit exceede= d." to<br> console. gdb does not really help here. I can provide all traces needed to<= br> find a solution for that.<br> <br> I strongly believe, it has something to do with my architecture and has<br> nothing to do with mono itself or any of the used components. A test with<b= r> GtkHTML patched into gtk-sharp gives the same result.<br> <br> Where is the correct place to catch that SIGXCPU and provide the signal bac= k<br> to app so my application is able to run?<br> <br> When the time has come and my application runs well I want to contribute al= l<br> of my patches to the several projects.<br> <br> Thanks and regards<br> <br> Maik<br> <br> _______________________________________________<br> Mono-gc-list maillist =A0- =A0<a href=3D"mailto:[email protected]= om">[email protected]</a><br> <a href=3D"http://lists.ximian.com/mailman/listinfo/mono-gc-list" target=3D= "_blank">http://lists.ximian.com/mailman/listinfo/mono-gc-list</a><br> </blockquote></div><br></div> --90e6ba181850fc650504a00a6eec-- --===============0820131594== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Mono-gc-list maillist - [email protected] http://lists.ximian.com/mailman/listinfo/mono-gc-list --===============0820131594==--