[DGD] Is Running Atomically.

Raymond Jennings shentino at gmail.com
Sat Sep 24 21:42:28 CEST 2016


Skotos (and others) used a trick of using tick counts to detect this.

Atomic code makes ticks burn twice as fast, so if you compare tick usage
outside and inside an inner atomic function, if they match you must already
be inside atomic context.

On Sat, Sep 24, 2016 at 12:07 PM, <bart at wotf.org> wrote:

> If you just want to deal with the file writes in the logging code, you
> could
> also simply catch() the write, and see what the error is, it will also tell
> you you are running atomic so you can respond to that.
>
> What I described is much more generic (without it requiring some dummy
> file to
> try writing to as a test)
>
> Bart.
>
> On Sat, 24 Sep 2016 20:15:27 +0200, bart wrote
> > This can actually be done in lpc without modifying the driver,
> > through it might mean modifying the kernel. The 'trick' is to cause
> > an error, catch it, and let your error handler tell you if the error
> > was atomic or not. I wrapped that in a nice afun (test_atomic()) and
> > added a TLS variable which gets set by the error handler whenever a
> > (caught) error in atomic code occurs.
>
> <snip>
>
> --
> http://www.flickr.com/photos/mrobjective/
> http://www.om-d.org/
>
> ____________________________________________
> https://mail.dworkin.nl/mailman/listinfo/dgd
>



More information about the DGD mailing list