SCOOPGEN

 

What is SCOOP?

The Simple Concurrent Object-Oriented Programming (SCOOP) mechanism introduces inter-object concurrency to the Eiffel language, via addition of one new keyword, separate. We describe a general tool that takes an Eiffel program that makes use of SCOOP and separate, and translates it into an Eiffel multi-threaded program that makes use of the standard EiffelBase THREAD class, which is thereafter compatible with EiffelStudio.

 

SCOOPGEN Introduction and Background

Many mechanisms exist for introducing concurrency into object-oriented (OO) programming languages. These approaches support the use of multiple, perhaps distributed processors, each of which may be executing multiple processes. Different techniques are provided with the languages to support synchronization, interruption, mutually exclusive access to object state, and atomic execution of routines.

The Simple Concurrent Object-Oriented Programming (SCOOP) mechanism was proposed as a way to introduce inter-object concurrency into the Eiffel programming language. The mechanism extends the Eiffel language by adding one keyword, separate, that can be applied to classes, entities, and formal routine arguments. Application of separate to a class indicates that the class is executing in its own thread of control; application of separate to entities or arguments indicate that these constructs are points of synchronization, and can be shared among concurrent threads. No implementation of SCOOP for ISE EiffelStudio exists.

We describe a tool, called the SCOOP-to-Eiffel Code Generator (SCOOPGEN), which translates Eiffel programs that use the SCOOP mechanism via separate, into standard Eiffel threaded applications that make use of Eiffel’s THREAD class. The results of applying the tool have been used successfully with EiffelStudio 5.4. SCOOPGEN can in theory be used with any version of Eiffel that provides an implementation of the THREAD class.

 

Step-by-step instructions for using SCOOPGEN

1. Create a project in EiffelStudio

2. Then create your classes in SCOOP Eiffel which will give you an ability to use EiffelStudio IDE, i.e. you use keyword separate for development of multi-threaded application (without compiling them)

3. Create a project file for SCOOPGEN in Notepad or any other text editor and save it with an extension .esp (in Notepad you put a file name with extension into quotation marks, i.e. "scoop_project.esp"). The file format is as follows: each line of it contains a name of a source file. The name of a root class should be preceded with a keyword root.

Example:

first.es

second.es

root root.es

4. Copy the contents of every class written in SCOOP Eiffel (just those using keyword separate) to Windows Notepad or any other text editor and save them with an extension es (put a file name with extension into quotation marks, i.e. "root.es") in the same folder as .esp file

5. Run generator.exe with following parameters:

generator.exe input_folder_name project_file_name output_folder_name

where

input_folder_name – full name for the folder containing .es files and .esp file

project_file_name – name of .esp file

output_folder_name – full name for the folder where files will be generated

i.e. generator.exe C:\Sample sample.esp C:\MyProjects\Sample

This will generate new files with an extension .e

6. If you still have project opened in EiffelStudio - close it

7. Replace a content of your ace file with an attached sample.ace

8. Replace YOUR_PROJECT_NAME in your new ace file with your project name and save it

9. Replace files created on step 2 with generated files

10. Open the project and add a thread library to your project

11. Compile your project

12. Now you can use your multi-thread application

 

Additional Information

  1. An article in the Journal of Technology (supposed to be in December 2004 issue of JOT). The article has a detailed description of SCOOPGEN presenting information about the previous works in this field, implementation details, technology overview and other useful information. This publication also contains an example of a program written with the help of SCOOPGEN.
  2. This article can be found here:

    SCOOP article

  3. Additional information on SCOOPGEN you can find on
  4. https://sourceforge.net/projects/scoop2eiffel/

  5. Some additional info and examples can be found at developers home page
  6. Nathaniel Fuks 'SCOOPGEN'

     

Contact Info:

If you have any questions or suggestions, you can forward them to:

Nathaniel Fuks nati@cs.yorku.ca