[erlang-questions] Re: Erlang linked in drivers, ErlDrvEntry structure

Paul Davis paul.joseph.davis@REDACTED
Thu Feb 25 17:47:33 CET 2010


Matt,

Ah. I'd stick with a driver for that. You could theoretically
implement that as a NIF, but there's not really much of a reason when
drivers are already meant for such things.

HTH,
Paul Davis

On Thu, Feb 25, 2010 at 11:00 AM, Evans, Matthew <mevans@REDACTED> wrote:
> Yes, I've looked at them and I think they have great potential.
>
> This particular application is going to be receiving asynchronous requests from drivers in the C/C++ world. I can do that using a port-driver, not sure if it can be done in a NIF (without blocking the scheduler). If it can, I'd love to see how.
>
> Matt
>
> -----Original Message-----
> From: Paul Davis [mailto:paul.joseph.davis@REDACTED]
> Sent: Thursday, February 25, 2010 9:51 AM
> To: Evans, Matthew
> Cc: sergey-miryanov; erlang-questions@REDACTED
> Subject: Re: [erlang-questions] Re: Erlang linked in drivers, ErlDrvEntry structure
>
> Matthew,
>
> If you're willing to play near the edge you might want to check out
> NIF's [1]. They're pretty awesome but have only been around for a
> couple releases.
>
> Paul Davis
>
> [1] http://www.erlang.org/doc/man/erl_nif.html
>
> On Thu, Feb 25, 2010 at 9:36 AM, Evans, Matthew <mevans@REDACTED> wrote:
>> Many thanks...that's just what I was after
>>
>> -----Original Message-----
>> From: erlang-questions@REDACTED [mailto:erlang-questions@REDACTED] On Behalf Of sergey-miryanov
>> Sent: Thursday, February 25, 2010 12:25 AM
>> To: erlang-questions@REDACTED
>> Subject: [erlang-questions] Re: Erlang linked in drivers, ErlDrvEntry structure
>>
>> Do you see this: http://www.erlang.org/doc/man/driver_entry.html?
>>
>> On Feb 25, 7:13 am, "Evans, Matthew" <mev...@REDACTED> wrote:
>>> Hi All,
>>>
>>> I've been looking at linkedin drivers a little. I 'm trying to find a description of all the handler functions that are contained in the ErlDrvEntry structure. Obviously startup and shutdown make sense, but what about all the others (see the example below)? When are they called (for example ready_input, handle, control, process)? Pointers to documentation would be helpful, the Erlang documentation inhttp://www.erlang.org/doc/man/erl_driver.htmlseems to be missing quite a few of them....
>>>
>>> Many thanks
>>>
>>> Matt
>>>
>>> static ErlDrvEntry basic_driver_entry = {
>>>     NULL,                             /* init */
>>>     start,                            /* startup */
>>>     stop,                             /* shutdown */
>>>     NULL,                             /* output */
>>>     NULL,                             /* ready_input */
>>>     NULL,                             /* ready_output */
>>>     "basic_drv",                      /* the name of the driver */
>>>     NULL,                             /* finish */
>>>     NULL,                             /* handle */
>>>     NULL,                             /* control */
>>>     NULL,                             /* timeout */
>>>     process,                          /* process */
>>>     NULL,                             /* ready_async */
>>>     NULL,                             /* flush */
>>>     NULL,                             /* call */
>>>     NULL,                             /* event */
>>>     ERL_DRV_EXTENDED_MARKER,          /* ERL_DRV_EXTENDED_MARKER */
>>>     ERL_DRV_EXTENDED_MAJOR_VERSION,   /* ERL_DRV_EXTENDED_MAJOR_VERSION */
>>>     ERL_DRV_EXTENDED_MAJOR_VERSION,   /* ERL_DRV_EXTENDED_MINOR_VERSION */
>>>     ERL_DRV_FLAG_USE_PORT_LOCKING     /* ERL_DRV_FLAGs */
>>>
>>> };
>>>
>>> ________________________________________________________________
>>> erlang-questions (at) erlang.org mailing list.
>>> Seehttp://www.erlang.org/faq.html
>>> To unsubscribe; mailto:erlang-questions-unsubscr...@REDACTED
>>
>> ________________________________________________________________
>> erlang-questions (at) erlang.org mailing list.
>> See http://www.erlang.org/faq.html
>> To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED
>>
>>
>> ________________________________________________________________
>> erlang-questions (at) erlang.org mailing list.
>> See http://www.erlang.org/faq.html
>> To unsubscribe; mailto:erlang-questions-unsubscribe@REDACTED
>>
>>
>


More information about the erlang-questions mailing list