• Gem #99: Reference Counting in Ada - Part 2: Task Safety

    This series of three Gems describes a possible implementation for automatic memory management via the use of reference counting. Part 1 explains how controlled types can be used to achieve automatic reference counting, and addresses some aspects of correct handling of reference counts. Part 2 analyzes a few issues related to tasking. Finally, Part 3 describes the use of weak reference counting. Continue Reading »

    Emmanuel Briot
    AdaCore
  • Gem #97: Reference Counting in Ada - Part 1

    This series of three Gems describes a possible implementation for automatic memory management, via the use of reference counting. Part 1 explains how controlled types can be used to achieve automatic reference counting, and addresses some aspects of correct handling of reference counts. Part 2 analyzes a few issues related to tasking. Finally, Part 3 describes the use of weak reference counting. Continue Reading »

    Emmanuel Briot
    AdaCore
  • Gem #93: High Performance Multi-core Programming - Part 1

    This Gem introduces an Ada implementation of "Chameneos-Redux," a benchmark program that compares the performance of threaded applications on a multi-core machine. In this series we explore the design and implementation techniques used to make a high-performance version of the program in Ada.

    Continue Reading »

    Pat Rogers
    AdaCore
  • Gem #81: GNAT Semaphores

    Ada Gem #81 — A previous Gem (#70, "The Scope Lock Idiom") discussed the occasional necessity of using low-level synchronization mechanisms instead of the higher-level protected object construct. The code in that Gem referenced the facilities of the Semaphores package located in the GNAT hierarchy. In this Gem, we examine the abstractions provided by that package, focusing especially on the design choices. Continue Reading »

    Pat Rogers
    AdaCore
  • Gem #79: Where did my memory go? (Part 3)

    Ada Gem #79 — A number of tools and libraries exist to monitor memory usage, detect memory leaks and more generally solve issues with memory management. The Gems in this three-part series offer an overview of these issues and explain how you can benefit from these tools in your own development. Continue Reading »

    Emmanuel Briot
    AdaCore
  • Gem #78: Where did my memory go? (Part 2)

    Ada Gem #78 — A number of tools and libraries exist to monitor memory usage, detect memory leaks and more generally solve issues with memory management. The Gems in this three-part series offer an overview of these issues and explain how you can benefit from these tools in your own development. Continue Reading »

    Emmanuel Briot
    AdaCore
  • Gem #77: Where did my memory go? (Part 1)

    Ada Gem #77 — A number of tools and libraries exist to monitor memory usage, detect memory leaks, and more generally solve issues with memory management. This Gem, and others to follow, offer an overview of these issues and explain how you can benefit from these tools in your own development. Continue Reading »

    Emmanuel Briot
    AdaCore
  • Gem #70: The Scope Locks Idiom

    Ada Gem #70 — This Gem marks a brief break from SPARK, which will return in two weeks with the first in a series of six Gems on that topic.
    Encapsulating shared variables inside protected operations is not always possible. This Gem shows how to add mutual exclusion to existing sequential code using a combination of controlled and protected types, such that the resulting code is robust and minimally changed. Continue Reading »

    Pat Rogers
    AdaCore
  • Gem #69: Let's SPARK! - Part 2

    Ada Gem #69 — Welcome back! We hope you had a great summer. Now let's get back to where we left off.
    In this Gem and the previous one, we give you a simple walkthrough of SPARK's capabilities and its integration with GPS. In the previous Gem, we showed how to set up a SPARK project and prove that your SPARK programs are free from uninitialized variable accesses and that they execute without run-time errors. In this Gem, we show how to prove that your SPARK programs respect given contracts. Continue Reading »

    Yannick Moy
    AdaCore
  • Gem #68: Let's SPARK! - Part 1

    Ada Gem #68 — Please note that this is the final Gem before we break for summer. The series will resume on September 7, 2009.

    In this Gem and the next one, we present a simple walk-through of SPARK's capabilities and its integration with GPS. In this first Gem, we show how to set up a SPARK project and prove that your SPARK programs are free from uninitialized variable accesses and that they execute without run-time errors.

    Continue Reading »

    Yannick Moy
    AdaCore
  • Gem #67: Managing the GPS Workspace

    Ada Gem #67 — GPS has a multitude of views and editors, several of which may be displayed on the screen at the same time. It is based on a very flexible desktop that helps you organize these windows the way you prefer. This Gem describes some of the lesser-known aspects of the GPS desktop. Continue Reading »

    Emmanuel Briot
    AdaCore
  • Gem #66: GPS's Key Shortcuts Editor

    Ada Gem #66 — Most GPS features are accessible through menus and contextual menus. However, for maximum efficiency most users prefer to use keyboard shortcuts. Although GPS comes with a number of predefined shortcuts, you might want to adapt them to your own habits, especially if you are moving from a previous editor. Continue Reading »

    Emmanuel Briot
    AdaCore
  • Gem #65: gprbuild

    Ada Gem #65 — gprbuild is a new program builder, superseding gnatmake. It supports multiple languages, automatically manages source dependencies, and reduces the need for recompilation. This Gem describes a high-level view of how gprbuild works. Continue Reading »

    Emmanuel Briot
    AdaCore
  • Gem #64: Handling Multiple-Unit Source Files

    Ada Gem #64 — This Gem describes how to compile applications in GNAT when source files contain multiple units. The preferred approach is to split source files, and here we describes how this can be done, although GNAT also provides a workaround that allows you to keep your existing files. Continue Reading »

    Emmanuel Briot
    AdaCore
  • Gem #63: The Effect of Pragma Suppress

    Ada Gem #63 — The features of Ada have generally been designed to prevent violating the properties of data types, enforced either by compile-time rules or, in the case of dynamic properties, by using run-time checks. Ada allows run-time checks to be suppressed, but not with the intent of allowing programmers to subvert the type system. Continue Reading »

    Gary Dismukes
    AdaCore
  • Gem #60: Generating Ada bindings for C++ headers

    Ada Gem #60 — In Gem #59 we saw how simple it is to automatically generate Ada bindings for C header files. In this Gem, we will see that, similarly, it's now also possible to generate Ada bindings for C++ header files. Continue Reading »

    Arnaud Charlet
    AdaCore
  • Gem #59: Generating Ada bindings for C headers

    Ada Gem #59 — One of the delicate areas of Ada that is often unfamiliar to developers is how to intermix Ada code with other programming languages. While Ada provides very powerful and complete capabilities to interface with other compiled languages such as C, C++, and Fortran, writing the Ada glue code that enables a programmer to use complex and large APIs can be tedious and error-prone.
    In this Gem, we will explore a new tool provided by AdaCore to automate the interface generation of C header files through the compiler. Continue Reading »

    Arnaud Charlet
    AdaCore
  • Gem #58: Ada / Java exception handling

    Ada Gem #58 — Ada and Java are two languages that rely heavily on exceptions. A large part of the Ada data model is based on the fact that data is checked at run time, and will raise various kinds of exceptions such as Constraint_Error when constraints are violated. Similarly, there are many cases where Java performs checks that can raise exceptions, among the most common being checks on casts and null dereferences. It is therefore extremely important to support exceptions that are properly propagated from one language to the other and even potentially caught/handled, without having to worry about the language of origin. Continue Reading »

    Quentin Ochem
    AdaCore
  • Gem #57: Ada / Java cross dispatching

    Ada Gem #57 — In the preceding Ada/Java interfacing Gem, we saw how to create calls from Ada to Java using ada2java and callbacks. We’re now going to go one step further, and discuss a cross-language dispatching mechanism that supports extension of an Ada tagged type in Java, allowing the possibility of making dispatching calls equally well from either side. Continue Reading »

    Quentin Ochem
    AdaCore
  • Gem #56: Creating Ada to Java calls using GNAT-AJIS

    Ada Gem #56 — In a previous Gem we introduced ada2java, which maps an Ada specification to a Java specification, to support calls from Java to Ada. Even though ada2java doesn't support creating Ada bindings of Java specs, it’s still possible to use it to support calls from Ada to Java. In this Gem we’ll look at a first possibility of doing this, using callbacks (in Ada terms, access-to-subprogram calls). Continue Reading »

    Quentin Ochem
    AdaCore
« Previous    1  2  3     Next »