Ann: Win32-notify 0.1

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Ann: Win32-notify 0.1

Niklas Broberg
Hi all,

I wanted to use hinotify, which gives notifications on file system
changes, but found (quite naturally) that it wouldn't run on my
windows machine (since it's a binding to the linux kernel). So I
started writing a library that would give similar functionality on
Windows. This is the first release of that, more a proof-of-concept
than anything useful at this stage:

http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Win32-notify-0.1

Still, feel free to test it, and I would love feedback on everything
from desired API to suggestions on how to implement the low-level
bindings more efficiently.

Cheers,

/Niklas
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Ann: Win32-notify 0.1

Conal Elliott
Hi Niklas,
I'd love to see this functionality available cross-platform.  Are there plans for a unified library with a single API?    Cheers, - Conal

On Sat, Apr 19, 2008 at 5:31 PM, Niklas Broberg <[hidden email]> wrote:
Hi all,

I wanted to use hinotify, which gives notifications on file system
changes, but found (quite naturally) that it wouldn't run on my
windows machine (since it's a binding to the linux kernel). So I
started writing a library that would give similar functionality on
Windows. This is the first release of that, more a proof-of-concept
than anything useful at this stage:

http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Win32-notify-0.1

Still, feel free to test it, and I would love feedback on everything
from desired API to suggestions on how to implement the low-level
bindings more efficiently.

Cheers,

/Niklas
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe


_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Ann: Win32-notify 0.1

Felix Martini
Conal Elliott:
> I'd love to see this functionality available cross-platform.  Are there
> plans for a unified library with a single API?

+1

It would be nice if the two inotify packages and this one could be
combined. And if someone would add a kqueue backend for the BSD's and
OSX then most platforms would be supported.
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Ann: Win32-notify 0.1

Niklas Broberg
In reply to this post by Conal Elliott
> I'd love to see this functionality available cross-platform.  Are there
> plans for a unified library with a single API?

Yep, that's the plan (not too far) down the line, me and Lennart (who
wrote the hinotify bindings) have already discussed it to some extent.
I think the work order will be

- get a decent API for Win32-notify up.
- create a cross-platform single-API package on top of Win32-notify
and hinotify.
- go back to Win32-notify and make the implementation less naive.

So API suggestions would be most welcome!

Cheers,

/Niklas
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Ann: Win32-notify 0.1

Bryan O'Sullivan
Niklas Broberg wrote:

> So API suggestions would be most welcome!

Your challenge will lie in finding an API that can be implemented
efficiently on all concerned platforms.  I don't know what the
characteristics of the Windows or OS X notification APIs are, but if you
use inotify on Linux, and you immediately issue a read every time select
tells you there's something to be read, you'll easily consume 70% of a
CPU when the filesystem gets busy.

With a little guile, you can reduce that overhead by two orders of
magnitude, to a fraction of a percent.  It's not all that easy to do
this well, but using inotify naively is so crippling that you must do
it.  Any higher-level API must account for factors like this.

        <b
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Ann: Win32-notify 0.1

David MacIver
On Sun, Apr 20, 2008 at 5:22 PM, Bryan O'Sullivan <[hidden email]> wrote:

> Niklas Broberg wrote:
>
>  > So API suggestions would be most welcome!
>
>  Your challenge will lie in finding an API that can be implemented
>  efficiently on all concerned platforms.  I don't know what the
>  characteristics of the Windows or OS X notification APIs are, but if you
>  use inotify on Linux, and you immediately issue a read every time select
>  tells you there's something to be read, you'll easily consume 70% of a
>  CPU when the filesystem gets busy.
>
>  With a little guile, you can reduce that overhead by two orders of
>  magnitude, to a fraction of a percent.  It's not all that easy to do
>  this well, but using inotify naively is so crippling that you must do
>  it.  Any higher-level API must account for factors like this.

Factor has a file system notification API that wraps windows, linux
and mac ones. It might be worth taking a look at that to see what it
does.
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: Ann: Win32-notify 0.1

Bit Connor
> Factor has a file system notification API that wraps windows, linux
> and mac ones. It might be worth taking a look at that to see what it
> does.

Mono also has such an API and I've heard very good things about it. It
would also be worth looking at.
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe