Hello Navaneeth,

One cannot ascertain from the JS code whether the call is going to block
the event loop or not. In libev, you would register a ev_io watcher and
listen for EV_READ, EV_WRITE (or both) events (ev_io_init() +
ev_io_start()) whenever the FD becomes readable/writable. I think the
equivalent of it is uv_poll_init() + uv_poll_start() in libuv.

Here is an example of the implementation in zeromq.node:
https://github.com/JustinTulloss/zeromq.node/blob/master/binding.cc#L312

Can you shed more light on what C shared library are you trying to bridge??

Shripad K.

On Sun, Aug 19, 2012 at 11:58 AM, Navaneeth KN <[email protected]>wrote:

> Hello,
>
> I have a C shared library. I am writing a node module for this library. I
> wrote a process function which can be accessed from JS and it calls my
> shared library function. In JS, it looks like,
>
> myLibrary.process(args, function(output) {
> });
>
> I am wondering, is this a non-blocking call or blocking one? Since I am
> not doing anything special to make it non-blocking, I assume this will be a
> blocking call. Or is Node doing something to make it non-blocking?
>
> If the above code is blocking, how do I make a non-blocking wrapper for
> this shared library? Should I use work queues from libuv?
>
> Any help would be great!
>
> Thanks
> Navaneeth
>
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to