Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Section A.8. Further Information - Pg. 223

Further Information Threads and Thread Safety Perl versions 5.004_50 and later include optional experimental support for multiple threads on many platforms. If the DBI is built using a Perl that has threads enabled, then it will use a per-driver mutex to ensure that only one thread is with a driver at any one time. Please note that support for threads in Perl is still experimental and is known to have some significant problems. Its use is not recommended. Signal Handling and Canceling Operations The first thing to say is that signal handling in Perl is currently not safe. There is always a small risk of Perl crashing and/or core dumping during or after handling a signal. (The risk was reduced with 5.004_04 but is still present.) The two most common uses of signals in relation to the DBI are for canceling operations when the user types Ctrl-C (interrupt), and for implementing a timeout using alarm() and $SIG{ALRM} . To assist in implementing these operations, the DBI provides a cancel method for statement handles. The cancel method should abort the current operation and is de- signed to be called from a signal handler.