[erlang-questions] erl_driver: is char *buf from control safe?

Michael Truog mjtruog@REDACTED
Wed Sep 10 08:57:58 CEST 2014


I am pretty sure GEPD has zero-copy working for binaries the way you want it:
https://github.com/okeuday/GEPD/
It would probably be similar to the pchar_test1.

On 09/09/2014 09:49 AM, Steve Vinoski wrote:
>
>
>
> On Tue, Sep 9, 2014 at 12:40 PM, Max Lapshin <max.lapshin@REDACTED <mailto:max.lapshin@REDACTED>> wrote:
>
>     I need to send binary to driver, do some  VERY cpu consumptive job with it (transcoding video) and return back.
>
>
>     I was trying to use dirty NIFs, but it seems to be very unstable: after several hours of work whole erlang machine becomes very, very slowly without any CPU usage.
>
>
> I'm very interested in seeing an example of this.
>
>     Now I try to migrate to erl drivers, but I've got new problem: I don't understand how to get zerocopy from erlang level to C level.
>
>
> Pass your data to the driver via port_command, as Lukas suggested. Implement the outputv callback and call driver_enqv to enqueue the incoming ErlIOVec argument into your driver queue. This won't copy. Also, since async threads are involved for doing the work, use the port data lock to protect the queue, as Lukas suggested.
>
> --steve
>
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20140909/2da8e6f6/attachment.htm>


More information about the erlang-questions mailing list