4 research outputs found

    Verrous basés sur futex pour les opérations atomiques génériques de C11

    Get PDF
    We present a new algorithm and implementation of a lock primitive thatis based on Linux' native lock interface, the futex systemcall. It allows us to assemble compiler support for atomic datastructures that can not be handled through specific hardwareinstructions. Such a tool is needed for C11's atomicsinterface because here an _Atomic qualification can be attachedto almost any data type. Our lock data structure for that purposemeets very specific criteria concerning its field of operation and itsperformance. By that we are able to outperform gcc'slibatomic library by around 60%

    Modular C

    Get PDF
    We propose an extension to the C standard called Modular C. It consists inthe addition of a handful of directives and a naming scheme transformingtraditional translation units into modules. The change to the C languageis minimal since we only add one feature, composed identifiers, to the corelanguage.Our modules can import other modules as long as the import relation remainsacyclic and a module can refer to its own identifiers and those of theimported modules through freely chosen abbreviations. Other thantraditional C's #include, our import directive ensures completeencapsulation between modules.The abbreviation scheme allows to seamlessly replace an imported module byanother one with equivalent interface. In addition to the export ofsymbols, we provide parameterized code injection through the import of``snippets''. This implements a mechanism that allows for code reuse,similar to X macros or templates.Additional features of our proposal are a simple dynamic moduleinitialization scheme, a structured approach to the C library and amigration path for existing software projects.The whole approach is validated by a formal description of a translationprocedure from Modular C to common C and a proof of the correctness ofthat procedure. Thereby we are able to show that the class of stableprograms can effectively be expressed in Modular C and that the gain ofmodularity is not thwarted by a loss of expressiveness. Here stableprograms are those that do not use extensive C macro facilities thatmanipulate identifiers.Our approach is implemented and used successfully and efficiently inseveral projects. Interfaces can easily be provided both ways, to interfaceexisting projects for Modular C or to interface Modular C libraries withother programming languagesNous proposons une extension au langage de programmation C, nomméC modulaire. Elle consiste en ajoutant une poignée de directives et d’un schéma denommage à transformer des unités de traduction traditionnelles en module. La modification au language-même est minimale, car nous y ajoutons une seul nouvelle caractéristique, les identifiants composés. Nos modules peuvent importer autre modulestant que la relation d’import reste acyclique et un module peut référer à ses propres identifiants et ceux des modules importés à l’aide d’abréviations librement choisis. Autre que l’include traditionnel, notre directive d’import assure l’encapsulationcomplète entre modules. Le schéma d’abréviation permet de facilement remplacer unmodule importé par un autre qui réalise le même interface. En plus à l’export desymboles nous fournissons l’injection de code paramétré par l’importation de snippets. Ceci implante un mécanisme de réutilisation de code, similaire au X-macro ou template. Des outils supplémentaires que propose notre approche sont un schémad’initialisation, un approche structuré à la bibliothèque standard de C et un cheminde migration pour des projets de logiciel existants
    corecore