Hatena::Grouperlang

weekend erlang programmer

ここの更新は止まってしまいました。面倒なので全部kuenishiの日記に書くことにしました。
 | 

{2009, 6, 8}

driver_entry for erlang linkedin drivers 11:30 はてなブックマーク - driver_entry for erlang linkedin drivers - weekend erlang programmer driver_entry for erlang linkedin drivers - weekend erlang programmer のブックマークコメント

yatceの特徴は、この辺りのことを狙っています(pptx注意)。

int control(ErlDrvData drv_data, unsigned int command, char *buf, int len, char **rbuf, int rlen)

This is a special routine invoked with the erlang function port_control/3. It works a little like an "ioctl" for erlang drivers. The data given to port_control/3 arrives in buf and len. The driver may send data back, using *rbuf and rlen.

This is the fastest way of calling a driver and get a response. It won't make any context switch in the erlang emulator, and requires no message passing. It is suitable for calling C function to get faster execution, when erlang is too slow.

If the driver wants to return data, it should return it in rbuf. When control is called, *rbuf points to a default buffer of rlen bytes, which can be used to return data. Data is returned different depending on the port control flags (those that are set with set_port_control_flags).

driver_entry

改めてこれ読んで、コピーがもう一回減らせそうな感じがしている。

 |