When are threads started in multi-threading mode?

9 views
Skip to first unread message

Colin Adams

unread,
Feb 21, 2019, 5:25:51 AM2/21/19
to eiffel-web-framework
When Eiffel threads are selected as the concurrency mode (not SCOOP), at what point is a new thread started? Is it for each request?

Jocelyn Fiat

unread,
Feb 21, 2019, 7:25:41 AM2/21/19
to eiffel-web-framework
It uses a pool of threads (see THREAD_POOL).
See HTTPD_CONNECTION_HANDLER.initialize , the size of the pool is max_concurrent_connections

A request is handled by the next available thread.
check POOLED_THREAD.execute code.


On Thu, Feb 21, 2019 at 11:25 AM Colin Adams <colinpa...@gmail.com> wrote:
When Eiffel threads are selected as the concurrency mode (not SCOOP), at what point is a new thread started? Is it for each request?

--
--
You received this message because you are subscribed to the Google
Groups "Eiffel Web Framework" group.
 
To post to this group, send email to
eiffel-web...@googlegroups.com
To unsubscribe from this group, send email to
eiffel-web-frame...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/eiffel-web-framework
 
See the site for the Eiffel-Web-Framework project at
https://github.com/EiffelWebFramework/EWF
---
You received this message because you are subscribed to the Google Groups "Eiffel Web Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eiffel-web-frame...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Jocelyn
------------------------------------------------------------------------
Eiffel Software
https://www.eiffel.com
Customer support: https://support.eiffel.com
User group: https://groups.google.com/forum/#!forum/eiffel-users
------------------------------------------------------------------------

Colin Adams

unread,
Feb 21, 2019, 9:07:24 AM2/21/19
to eiffel-web-framework
Looks odd. I see an instance of the separate keyword in the thread version of HTTP_CONNECTION_HANDLER.

Colin Adams

unread,
Feb 21, 2019, 9:15:44 AM2/21/19
to eiffel-web-framework
max_concurrent_connections is a configuration setting. Can you please remind me how these configuration settings are made?

On Thu, 21 Feb 2019 at 12:25, Jocelyn Fiat <jf...@eiffel.com> wrote:

Jocelyn Fiat

unread,
Feb 21, 2019, 9:28:03 AM2/21/19
to eiffel-web-framework
> Looks odd. I see an instance of the separate keyword in the thread version of HTTPD_CONNECTION_HANDLER.

indeed, it is useless, in "thread" concurrency mode, "separate" keyword is ignored.
And for EiffelWeb standalone, when compiled with scoop concurrency, we use another implementation. But indeed, to have EiffelWeb working in any concurrency mode, we had to factorize as much code as possible, and this "separate" keyword in thread implementation is just a left-over of copy/paste between the various implementations.

>max_concurrent_connections is a configuration setting. Can you please remind me how these configuration settings are made?
you can have a look at the simple example.

Or using the WSF_STANDALONE_SERVICE_OPTIONS  from the wsf_standalone library with the following code

    initialize
            -- Initialize current service.
        local
            opts: WSF_STANDALONE_SERVICE_OPTIONS
        do
                -- Specific to `standalone' connector (the EiffelWeb server).
                -- See `{WSF_STANDALONE_SERVICE_LAUNCHER}.initialize'
            create opts
            opts.port := 9090
            opts.set_max_concurrent_connections (10)

            opts.import_ini_file_options ("simple.ini")
            import_service_options (opts)
        end


Colin Adams

unread,
Feb 21, 2019, 9:46:00 AM2/21/19
to eiffel-web-framework
I can't find the class WSF_STANDALONE_SERVICE_OPTIONS (it may be we are running an earlier version of the software). My copy of WSF_LAUNCHABLE_SERVICE has a set_service_option which we currently use for setting the port to listen on. This uses a WSF_LAUNCHER_SERVICE_OPTIONS object.

WSF_STANDALONE_SERVICE_LAUNCHER supports an option named max_concurrent_connections, so I can use set_service_option to set it, by the look of it.

Jocelyn Fiat

unread,
Feb 21, 2019, 10:23:35 AM2/21/19
to eiffel-web-framework
Indeed.
Note WSF_STANDALONE_SERVICE_OPTIONS is part of the wsf_standalone library
...\wsf\connector\standalone\wsf_standalone_service_options.e

Do you use a version from git repository, or from EiffelStudio ?
In both case, which version?

It may also be a good idea to look at https://github.com/EiffelWebFramework/EWF/blob/master/CHANGELOG.md to see if you are not missing anything important by using an old version of EiffelWeb.

-- Jocelyn

Colin Adams

unread,
Feb 21, 2019, 10:30:13 AM2/21/19
to eiffel-web-framework
From git.
How do I find out the version? It certainly isn't the latest - looking at the dates in that changelog. We're at least a year old I guess. probably more.

Colin Adams

unread,
Feb 21, 2019, 10:37:15 AM2/21/19
to eiffel-web-framework
Seraching our git log, the most recent commit I can find that mentions EWF was October 2016.

Jocelyn Fiat

unread,
Feb 22, 2019, 2:44:34 AM2/22/19
to eiffel-web-framework
Since that period, EiffelWeb got improved.
I would recommend to update your copy.
Reply all
Reply to author
Forward
0 new messages