[erlang-questions] driver_output_term, driver_send_term and ei

Joel Reymont joelr1@REDACTED
Thu Aug 30 14:33:52 CEST 2007


It seems that the erl_driver docs recommend using driver_output_term  
for efficiency reason.

It seems the difference bewteeen driver_output_term and  
driver_send_term is that the former only sends data to the port owner  
process.

I noticed that Klacke uses driver_send_term in his posregex linked-in  
driver. Would driver_output_term work just as well if the driver was  
given the pid of the caller to be given back to the port owner process?

Generally speaking, are there guidelines for when to use each function?

Should I use term_to_binary nowadays to send data to the driver, ei  
to decode in the driver and driver_output_term to send back?

	Thanks, Joel

P.S. I'm familiar with the FFI in Lisp, Haskell and OCaml. I must  
admit that the Erlang FFI seems to be the most pain in the rear of  
them all. I think it's also the least efficient when dealing with GUI  
APIs like Cocoa on the Mac since data needs to be convert to and from  
Erlang binaries and then back to C structures.

--
http://wagerlabs.com




More information about the erlang-questions mailing list