Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > e3d62627d1d1aab7ab1be2dd7f65a872 > files > 286

ecl-10.4.1-1.fc14.x86_64.rpm

<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>7.4.&#160;Considerations when embedding ECL</title><link rel="stylesheet" href="ecl.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.75.2"><link rel="home" href="index.html" title="The ECL manual"><link rel="up" href="ch22.html" title="Chapter&#160;7.&#160;Signals and interrupts"><link rel="prev" href="ch22s03.html" title="7.3.&#160;Signals and interrupts in ECL"><link rel="next" href="ch22s05.html" title="7.5.&#160;Signals Reference"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">7.4.&#160;Considerations when embedding <span class="application">ECL</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch22s03.html">Prev</a>&#160;</td><th width="60%" align="center">Chapter&#160;7.&#160;Signals and interrupts</th><td width="20%" align="right">&#160;<a accesskey="n" href="ch22s05.html">Next</a></td></tr></table><hr></div><div class="section" title="7.4.&#160;Considerations when embedding ECL"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="ext.signals.embedding"></a>7.4.&#160;Considerations when embedding <span class="application">ECL</span></h2></div></div></div><p>There are several approaches when handling signals and interrupts in
  a program that uses <span class="application">ECL</span>. One is to install your own signal handlers. This
  is perfectly fine, but you should respect the same restrictions as <span class="application">ECL</span>.
  Namely, you may not execute arbitrary code from those signal handlers, and
  in particular it will not always be safe to execute Common Lisp code from
  there.</p><p>If you want to use your own signal handlers then you should set the
  appropriate options before invoking <code class="function">cl_boot()</code>, as
  explained in <a class="xref" href="re41.html" title="ecl_set_option"><code class="function">ecl_set_option</code></a>. Note that in this
  case <span class="application">ECL</span> will not always be able to detect floating point exceptions,
  specially if your compiler does not support C99 and the corresponding
  floating point flags.</p><p>The other option is to let <span class="application">ECL</span> handle signals itself. This would be
  safer when the dominant part of the code is Common Lisp, but you may need
  to protect the code that embeds <span class="application">ECL</span> from being interrupted using either
  the macros <a class="xref" href="re44.html" title="ecl_disable_interrupts"><code class="function">ecl_disable_interrupts</code></a> and <a class="xref" href="re45.html" title="ecl_enable_interrupts"><code class="function">ecl_enable_interrupts</code></a> or the POSIX functions
  <code class="function">pthread_sigmaks</code> and
  <code class="function">sigprocmask</code>.</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch22s03.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="ch22.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="ch22s05.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">7.3.&#160;Signals and interrupts in <span class="application">ECL</span>&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;7.5.&#160;Signals Reference</td></tr></table></div></body></html>