develooper Front page | perl.perl5.porters | Postings from August 2001

Re: Async::Callback (was: Re: Asynchronous callbacks from C)

Thread Previous | Thread Next
From:
Richard Soderberg
Date:
August 7, 2001 05:40
Subject:
Re: Async::Callback (was: Re: Asynchronous callbacks from C)
Message ID:
NAEKLNAAHLMBPMPNBMLEKEEKDKAA.rs@oregonnet.com
Bouncing your reply back to p5p for the archives.

R.

-----Original Message-----
From: David M. Lloyd [mailto:dmlloyd@tds.net]
Sent: Wednesday, August 01, 2001 11:46 AM
To: Richard Soderberg
Cc: perl5-porters@perl.org
Subject: Re: Async::Callback (was: Re: Asynchronous callbacks from C)


On Tue, 31 Jul 2001, Richard Soderberg wrote:

> Could you provide a variant that is reentrant?  That would be quite
> useful :)

Technically it's still possible to use the module in a reentrant fashion
(at the cost of speed).  What you do is register your callback and
enable
it right away in a non-critical section, then have your callback check a
flag.  If the flag is false, just return.  Then all your asychronous
code
has to do is set the flag when you want the callback to do its stuff.

Granted there's a slight performance hit involved, but I can't think of
a
faster way to do this.

- D

<dmlloyd@tds.net>


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About