SCOOP and the Process + Thread Libraries

14 views
Skip to first unread message

Larry Rix

unread,
Jan 22, 2019, 9:33:06 AM1/22/19
to Eiffel Users
I have a library which uses the Process + Thread libraries. The concurrency setting is set to "thread" in this library. Switching it to "scoop" causes a configuration error when attempting to compile.

For example: I change the concurrency setting from "<concurrency support="thread" use="thread"/>" to "<concurrency support="scoop" use="scoop"/>".

This causes the error:

Error code: VD01

Error: A library used by the current project or a parent target used by the current target cannot be used under the selected settings.
What to do: Lower your requirements or update the library or the parent target to match them.

Capability "Concurrency" of dependent target has value "Thread" insufficient for current target setting "SCOOP".
Current target
Name: test
System: framework
File: C:\Users\LJR19\OneDrive\Documents\GitHub\framework\framework.ecf
Dependent target
Name: process
System: process
File: c:\program files (x86)\eiffel software\eiffelstudio 18.11 gpl\library\process\process.ecf

I have considered that I ought not use the process library at all.

What do I use process for?

I use the process library to execute external DOS shell commands. Generally, I wait until the command is finished (sequential execution) before continuing. Sometimes, I want to do concurrent execution.

I suppose what I need to do is learn how to execute DOS shell commands without the process library and then I can just replace those bits in my "Framework" library (totally outdated and stale name, I know) and then ditch the process (plus thread) library completely!

Otherwise—my questions remain:

1. What does "support" mean?
2. What does "use" mean?
3. How do they relate and interact with each other? (what are the rules and boundaries, perhaps use cases?)


Thanks,

Larry

Alexander Kogtenkov

unread,
Jan 22, 2019, 11:02:28 AM1/22/19
to eiffel...@googlegroups.com
I would suggest using base_process library instead. It works with and without SCOOP. The main difference from the "regular" process library is lack of agent-based input-output redirection. If you do not use such functionality, it would be a good replacement.

Alexander Kogtenkov


Larry Rix <lar...@moonshotsoftware.com>:

Larry Rix

unread,
Jan 22, 2019, 11:25:07 AM1/22/19
to Eiffel Users
Thanks for the suggestion, Alex

Do you know what I can use to replace PROCESS and PROCESS_FACTORY in base_process?

image.png

Larry Rix

unread,
Jan 22, 2019, 11:26:30 AM1/22/19
to Eiffel Users
Well—I just answered my own question pretty easily! BASE_PROCESS and BASE_PROCESS_FACTORY.

Larry Rix

unread,
Jan 22, 2019, 11:29:25 AM1/22/19
to Eiffel Users
Okay—at first glance, Alex's solution of dropping the thread library and using base_process appears to have worked. My library is now using SCOOP instead of Thread.

What I still do not understand is the different between "support" and "use" in the <concurrency ... /> tag in the ECF.

Thoughts?

Alexander Kogtenkov

unread,
Jan 22, 2019, 11:49:01 AM1/22/19
to eiffel...@googlegroups.com

What I still do not understand is the different between "support" and "use" in the <concurrency ... /> tag in the ECF.

In general, it's better to use EiffelStudio to edit project settings. Doing it by hand may lead to unexpected results, because there are different versions of ECF schema, and EiffelStudio takes them into account.

In ECF, the attribute "support" keeps the supported capability value (it is used for compatibility checks only), the attribute "use" - the value of the setting for the target as a root (it is used for selecting compilation options of the system only). More detailed information can be found here: https://www.eiffel.org/doc/eiffelstudio/Language_and_Capabilities

Alexander Kogtenkov

Larry Rix

unread,
Jan 22, 2019, 12:01:24 PM1/22/19
to Eiffel Users
Thank you for the feedback, Alex.

I do understand the general notion of using Eiffel Studio to edit the ECF. However—I manually hacked the ECF because Eiffel Studio was not allowing me to make the change, which perhaps needs more explanation as to why that happens and what is wrong, so I can make the change (i.e. the Concurrency setting is empty, I try to change it to SCOOP, and Eiffel Studio will not make the change).

Larry Rix

unread,
Jan 22, 2019, 12:02:41 PM1/22/19
to Eiffel Users
CORRECTION: I used the word Concurrency, but the actual configuration setting is Capability.

Larry Rix

unread,
Jan 22, 2019, 1:20:09 PM1/22/19
to Eiffel Users
FWIW/FYI

I could not get the DOS shell std_out to stream back in such a way that I could get it into a STRING for output from the command line call.

I had to resort to sending the output into a UUID-named file, getting the file contents, and then deleting the file. A very non-optimal way to do this.

Suggestions?

Alexander Kogtenkov

unread,
Jan 22, 2019, 3:11:47 PM1/22/19
to eiffel...@googlegroups.com

I could not get the DOS shell std_out to stream back in such a way that I could get it into a STRING for output from the command line call.

I had to resort to sending the output into a UUID-named file, getting the file contents, and then deleting the file. A very non-optimal way to do this.

Suggestions?

I did not have time to finish a complete example with SCOOP+(Base)Process+Vision2, but I've prepared a simplified version of the code to launch a command with redirection that does not require an intermediate file. I'm sending the archive by a private email to avoid cluttering the mailing list.

Alexander Kogtenkov
Reply all
Reply to author
Forward
0 new messages