Section: New Results
Functional and concurrent programming
Participants : Frédéric Boussinot, Ilaria Castellani, Florian Loitsch, Cyprien Nicolas, Manuel Serrano.
Bigloo
Software distribution: The new Bigloo branch 3.2 has been released this year. This branch has introduced the following novelties:
Bigloo packaging: In order to spread Bigloo and Hop more easily, we are currently working on building the packages for several Linux distributions. We have thus accommodated the Bigloo install process to these distributions. So far, Bigloo is now compatible with the demanding Debian distribution model.
New FairThread support: The previous releases of the Bigloo compiler, prior to 3.2c, come with two multi-threading APIs, named pthread and fthread. The former is an implementation of the Posix's threading library, based on the primitives provided by the LibC, or constructed over Java or the .NET thread system, the latter relies on the same base, but offered cooperative scheduling of threads. The developer had the choice to use one of these APIs to write multi-threaded programs in Bigloo.
In the new Bigloo version the developers may use both APIs at the same time, which means that they are able to embed one fthread scheduler into a pthread. We also wanted to rewrite the fthread API in Scheme only, and make calls to the pthread API to manage fthread life cycle and scheduling (which means locks in practice). These changes have been included in release 3.2c, where fthreads are now thread-safe with pthreads.
A new fast multi-threaded DNS support: The traditional BSD implementation of sockets uses function that are not thread-safe (gethostbyname , gethostbyaddr , ...). Hence, the only way to use these functions in a multi-threaded context is to protect each call with mutexes. Unfortunately, this is intrinsically inefficient. If at some point of the execution a DNS is answering to one host, all the other running threads that are also needing information from the DNS will get blocked too. In the context of Hop this may reduce dramatically the overall performance of the whole server. To get rid of this problem, we have implemented a new cache DNS for Bigloo . It is thread-safe and uses no lock. It is based on the POSIX-1 functions getaddrinfo . This new implementation has significantly increased the performance of the Hop web server.
Cryptography: We have implemented a cryptography library for Bigloo . This library supports most of the common cryptographic primitives. Among the public-key cryptography systems it includes RSA, DSA, and ElGamal. It furthermore features the following block-ciphers: AES, CAST128, DES, and IDEA.
Floating-point: We have developed a fast binary-to-decimal floating-point conversion. It is up to 5 times faster than previously existing techniques. We have explored different use-cases and implemented different variants. The fastest and simplest solution produces decimal representations that might be unnecessarily long. Evolutions trim the output to produce shorter outputs. The algorithm can furthermore be adapted to produce the shortest possible output, but in this case it will reject a small percentage (about 0.6%) of all possible IEEE 754 floating-point numbers.
FunLoft
This year, the effort has been concentrated on developing several aspects of FunLoft, according to the objectives of the PARTOUT project.
- Efficient Programming.
The implementation in the FunLoft compiler of the garbage collection RGC (for reactive garbage collector) has been completed. RGC is adapted to the synchronous/reactive framework and is partially based on a reference counting approach. RGC is tested on a list of benchmarks, including a graphical simulation of colliding particles, using multicore. RGC is presently only described in an internal report.
- Distributed Programming.
Primitives for distributed programming have been introduced in FunLoft, and tested on a little "ping-pong" demo. This work is currently under development. We use Hop as a "proxy" for distribution and, in the course of the project PARTOUT, we plan to propose Hop as a general interface for SugarCubes and ReactiveML.
- Safe Programming.
FunLoft proposes ways of programming without data-races which preserve the natural atomicity of user programs within a multicore framework. Basically, FunLoft states a memory separation property which is statically checked. A paper considering a kernel in which the soundness of the approach could be formally proved is under work.
- Dynamic Aspects.
A small language to program reactive scripts has been designed and a first experimental version of it has been implemented in FunLoft. The scripts actually do not define new functions for data manipulations, but rather just describe some kind of "orchestration" of calls of already existing functions. The production of SugarCubes code is also planned. A paper is in the course of being written on that matter.