Re: Module development advice
Max Englander <[email protected]> Sat, 10 Nov 2007 13:26:08 -0800 (PST)
| Newsgroups | gmane.network.irc.irssi.devel |
|---|---|
| Message-ID | <[email protected]> |
--0-1380204112-1194729968=:81927 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable I have another issue related to my module development. My module has two components, a client and a service. The client sends co= mmands and requests to AMIP (Winamp/iTunes/fb2k plugin), and certain requ= ests receive responses. The service listens for unsolicited messages from= AMIP, such as "play", "pause", etc.. Because I cannot run the service within the Irssi thread (would block nor= mal Irssi usage), I have to decouple the service from Irssi somehow. I ha= ve begun development using libpthread, but this creates a problem. Irssi = is not linked, nor provides the option to link, with libpthread. When Irs= si calls dlclose() on my module, it segfaults. This occurs because of (pe= rhaps) a bug in dlclose() which creates an error when a non-pthread-linke= d parent unloads a pthread-linked module. I was able to create a fix for = this by linking Irssi with libpthread. I have a few questions about this fix, and other possible non-threaded so= lutions. * Will linking Irssi with libpthread create other issues in Irssi? * Could Irssi distribute with a --with-pthreads option to allow for pthre= aded modules? * If I loaded my module from perl (build an Xs module), would this circum= vent the dlclose() problem or simply move the point of fault to a differe= nt location (seeing as the perl interpreter is loaded in Irssi as a modul= e, if I'm not mistaken) ? * Would using perl threads allow me to safely and efficiently decouple th= e service from Irssi? Any other ideas on how to efficiently decouple my service (fork, exec* + = FIFOs/sockets, etc.) would also be greatly appreciated. Thanks, Max __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around=20 http://mail.yahoo.com=20 --0-1380204112-1194729968=:81927 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable I have another issue related to my module development.<br><br>My module h= as two components, a client and a service. The client sends commands and = requests to AMIP (Winamp/iTunes/fb2k plugin), and certain requests receiv= e responses. The service listens for unsolicited messages from AMIP, such= as "play", "pause", etc..<br><br>Because I cannot run the service within= the Irssi thread (would block normal Irssi usage), I have to decouple th= e service from Irssi somehow. I have begun development using libpthread, = but this creates a problem. Irssi is not linked, nor provides the option = to link, with libpthread. When Irssi calls dlclose() on my module, it seg= faults. This occurs because of (perhaps) a bug in dlclose() which creates= an error when a non-pthread-linked parent unloads a pthread-linked modul= e. I was able to create a fix for this by linking Irssi with libpthread.<= br><br>I have a few questions about this fix, and other possible non-thre= aded solutions.<br>* Will linking Irssi with libpthread create other issues in Irssi?<br>* Could Irssi distribut= e with a --with-pthreads option to allow for pthreaded modules?<br>* If I= loaded my module from perl (build an Xs module), would this circumvent t= he dlclose() problem or simply move the point of fault to a different loc= ation (seeing as the perl interpreter is loaded in Irssi as a module, if = I'm not mistaken) ?<br>* Would using perl threads allow me to safely and = efficiently decouple the service from Irssi?<br><br>Any other ideas on ho= w to efficiently decouple my service (fork, exec* + FIFOs/sockets, etc.) = would also be greatly appreciated.<br><br>Thanks,<br>Max<br><p> _____= _____________________________________________<br>Do You Yahoo!?<br>Tired = of spam? Yahoo! Mail has the best spam protection around <br>http://mail= .yahoo.com=20 --0-1380204112-1194729968=:81927--