updated wikidocs related to SCOOP. (Signed-off-by: b-meyer).

git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@1434 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
eiffel-org
2015-09-28 10:28:44 +00:00
parent 5e7183f738
commit 03cc1e3660
7 changed files with 113 additions and 51 deletions

View File

@@ -0,0 +1,39 @@
[[Property:uuid|5422DF33-848E-491F-A761-21B545F425B4]]
[[Property:weight|0]]
[[Property:title|Graphics with concurrency]]
How can I build a concurrent graphical in application in Eiffel?
Eiffel has a great library for producing graphical applications: EiffelVision. Eiffel also has a powerful concurrency mechanism: SCOOP.
How do you make the two work together? This note gives you simple guidelines to ensure that the EiffelVision-SCOOP marriage is a harmonious and productive one.
The first question: why does the problem even exist? Let’s go back to the pre-SCOOP days. Any graphical application has an “event loop”, which keeps watching for graphical user events, such as a mouse click, and triggering the corresponding application responses, such as saving a file (if the user clicked “OK” on a File Save dialog). If you were using multithreading, the event loop would run in the main thread, also called the GUI (Graphical User Interface) thread.
Enter SCOOP. The old technique cannot work because a processor stuck in a loop cannot process any logged call! If you perform calls on a graphical widget, say the OK button, they will be logged right away, but they can only execute once the processor has exited its event loop. Not what you want.
So here is what you should do:
Since your application uses SCOOP, somewhere it creates a separate object. Let the creation instruction be
create s.make
where s is of a separate type (e.g. separate T).
In the "make" creation procedure, create an EV_APPLICATION object, using an instruction such as
create my_app
with my_app of type EV_APPLICATION.
Still in "make", create all the GUI elements. They will all be in the same processor that created the EV_APPLICATION object.
Also in "make", start the application, using
my_app.launch
In the pre-SCOOP world, launch would start the event loop. Here it only creates a separate object (of type EV_APPLICATION_HANDLER), which will run the event loop, forwarding events to the EV_APPLICATION object.
This is all the make procedure should do. Make sure it terminates with the preceding step. Otherwise, the event loop will never run!
Now you can start using EiffelVision as you are used to, by sending GUI requests to the EV_APPLICATION object:
o For requests coming from the same processor as s, just use the EV_APPLICATION object directly.
o For requests coming from another processor, you need access to that object; you can get it for example by through the feature ev_separate_application of class EV_SHARED_APPLICATION}.
That's all! Happy concurrent Eiffeling.

View File

@@ -1,6 +1,7 @@
[[Property:title|Concurrent Eiffel with SCOOP]]
[[Property:link_title|SCOOP]]
[[Property:title|Concurrent programming with SCOOP]]
[[Property:weight|1]]
[[Property:uuid|151838da-80f0-5381-d557-5c5b7727647d]]
[[Property:uuid|5FE312E0-0AC6-465C-AD3B-D5D73AAE566F]]
==Overview==
SCOOP is ''Simple Concurrent Object-Oriented Programming''. SCOOP allows developers to create object-oriented software systems which will take advantage of multiple, concurrently active execution engines while providing strong guarantees that allow programmers to reason like in sequential programs. Read further to get a better idea of what all this means, but for now, the primary message should be: SCOOP is concurrent software development made easy. The basic SCOOP ideas were first published as early as 1993. Since that time, considerable research and development has refined the SCOOP into the model that is implemented in EiffelStudio today.

View File

@@ -1,10 +1,11 @@
[[Property:title|EiffelThread]]
[[Property:link_title|EiffelThreads]]
[[Property:title|EiffelThreads]]
[[Property:weight|0]]
[[Property:uuid|d1e4c873-3e04-f49a-f6d2-6b9845f1e109]]
==EiffelThread Library==
[[Property:uuid|AAF0CEF9-7268-492F-9119-872164995898]]
==EiffelThreads Library==
Type: Library<br/>
Platform: Any
The EiffelThread library includes the main components needed to build multithreaded systems.
The EiffelThreads library includes the main components needed to build multi-threaded systems.

View File

@@ -1,7 +1,23 @@
[[Property:title|Concurrent computing]]
[[Property:link_title|Concurrency]]
[[Property:title|Concurrency]]
[[Property:weight|-10]]
[[Property:uuid|7c7a399a-076f-fd13-9b5f-f110c212e2e8]]
== Concurrent Computing Solutions ==
[[Property:uuid|E76EF4EE-0D90-4AEE-8521-0293A0086AA2]]
== Building concurrent applications in Eiffel ==
'''Concurrency''' is a system's ability to perform several tasks at a time, as with an email client that can download new messages while you are scrolling through previously donwloaded ones.
Many applications need concurrency, either for convenience or out of sheer necessity. Operating systems provide a concurrency mechanism in the form of "threading": a program can start several concurrent lines of control, or threads, which run in parallel.
In most programming languages, the way to obtain threaded applications is to rely on a threading library. Eiffel offers this possibility through the [[Eiffelthreads|EiffelThreads library]].
Thread libraries are at a lower level of abstraction than modern programming languages, requiring you to manage the interaction of threads manually through such techniques as mutual exclusion semaphores. Eiffel offers a higher-level mechanism: [[SCOOP]] (Simple Concurrent Object-Oriented Programming), which greatly simplifies the writing of concurrent applications and avoids many of the typical pitfalls of concurrency such as "data races". SCOOP is the recommended approach to concurrent Eiffel programming.
For details see:
* The [[SCOOP|SCOOP documentation]] for the recommended approach to concurrent programming in Eiffel.
* The [[EiffelThreads|EiffelThreads documentation]] if you need to exert fine control on the execution and synchronization of threads.

View File

@@ -0,0 +1,4 @@
[[Property:uuid|D1DDF411-5387-4A81-9A85-3EF8A2A4220D]]
[[Property:weight|0]]
[[Property:title|How to build a concurrent graphical application: EiffelVision with SCOOP]]
This page will be updated shortly with a short tutorial on how to use EiffelVision to provide a graphical user interface for a SCOOP-based concurrent application.

View File

@@ -1,7 +1,7 @@
[[Property:link_title|GUI building]]
[[Property:title|Graphical applications]]
[[Property:link_title|Graphics]]
[[Property:title|Graphics]]
[[Property:weight|-14]]
[[Property:uuid|df3cec75-5fe4-7b6b-c5f3-f07932857e70]]
[[Property:uuid|19E0CFF0-C2B2-4BA7-ADBA-1DDD0DE32212]]
== Graphical user interface building solutions ==
Eiffel provides platform-independent graphical user interface (GUI) facilities, particularly:

1
documentation/version Normal file
View File

@@ -0,0 +1 @@
trunk