From: Miriam P. V. <mir...@gm...> - 2006-04-27 13:31:46
|
> > Up to know is for sure we'll be making severe changes into the client. > > - C part will almost dissapear. There will only be erlang node and C > > part will be linked in erlang. It will have only functions for tapup , > > reading and writing. > > Could you ellaborate a bit more in the motivations of this? Of course. :) https://intranet.igalia.com/twiki/bin/view/Devserval/LinkingIn >From my point of view, there are three bad issues about the actual way of communication between the C node and the Erlang Node. The first one is about Fault tolerance, the second one is about performance, and the third about competences. 1. Fault tolerance. One of the main reasons for have chosen Erlang in the implementation was that its ability to make a fault-tolerance system. The actual way of communication between C node and Erlang node suggests us that the C node is actually monitorizing Erlang node. It should be just the opposite. The "stable" node should monitorize the "unstable". 2. Performance The C program resides in another OS process than the Erlang runtime system. This is not acceptable as it is a driver with very hard time requirements. It is therefore possible to write a program in C according to certain principles and dynamically link it to the Erlang runtime system, this is called a linked-in driver. Linked-in drivers involves writing certain callback functions in C. Very good skills are required as the code is linked to the Erlang runtime system. To call a function in the port drive requires no context changes, But its also very unsecure, as a fail in the driver makes the whole erlang node fail. 3. Competences. Thus linking in C node into erlang, we should decrease the responsability of the C node to its almost disappearance. The C code should only be for reading and writing to tap. We won't need more trheads, mutex, signals handling, neither no more sincronitation problems between c node and erlang node, no more duplicated config files , etc. I've not learned yet in detail how to make the link but I've seen some source code of linked drivers. That seems like making a callback module in erlang with a certain structure and the C code shall be only few simple lines for reading writing and open the logical device. Cheers!. |