You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ignite.apache.org by 李玉...@163, 18...@163.com on 2017/03/13 13:03:15 UTC

About thread problem of service execution in Ignite Service Grid

Hi

When in service grid service execution, if the local node deployment 
services, will directly call the local deployment service, otherwise it 
will find the service in the grid.

The local service, and the caller will use the same thread, in this 
case, the two threadss state is different, that is to say, the same 
call, have different behavior in different scene, I think the design is 
not reasonable.

For example, a thread local variable is defined, and according to the 
above description, the value of the same variable may be different for 
different scenarios.



Re: About thread problem of service execution in Ignite Service Grid

Posted by Valentin Kulichenko <va...@gmail.com>.
What is "consistent behavior"? Thread local in service just don't make
sense to me, it's a misuse. If you use API properly, you will not such
issues.

BTW, it's better to ask such questions on user list, not dev list. Please
do so for further questions.

-Val

On Tue, Mar 14, 2017 at 1:55 PM, 李玉珏@163 <18...@163.com> wrote:

> This problem occurs in a stand-alone development environment, as well as
> multiple node deployment environment.
> I think it is reasonable to say that no matter where the service is
> accessed, it is a different thread, which will ensure consistent behavior.
>
>
> 在 2017/3/13 23:52, Valentin Kulichenko 写道:
>
>> Why would you use a thread local in a service? What design you think is
>> reasonable?
>>
>> -Val
>>
>> On Mon, Mar 13, 2017 at 2:03 PM, 李玉珏@163 <18...@163.com> wrote:
>>
>> Hi,
>>>
>>> When in service grid service execution, if the local node deployment
>>> services, will directly call the local deployment service, otherwise it
>>> will find the service in the grid.
>>>
>>> The local service, and the caller will use the same thread, in this case,
>>> the two threads‘s state is different, that is to say, the same call, have
>>> different behavior in different scene, I think the design is not
>>> reasonable.
>>>
>>> For example, a thread local variable is defined, and according to the
>>> above description, the value of the same variable may be different for
>>> different scenarios.
>>>
>>>
>>>
>>>
>
>

Re: About thread problem of service execution in Ignite Service Grid

Posted by 李玉...@163, 18...@163.com.
This problem occurs in a stand-alone development environment, as well as 
multiple node deployment environment.
I think it is reasonable to say that no matter where the service is 
accessed, it is a different thread, which will ensure consistent behavior.

\u5728 2017/3/13 23:52, Valentin Kulichenko \u5199\u9053:
> Why would you use a thread local in a service? What design you think is
> reasonable?
>
> -Val
>
> On Mon, Mar 13, 2017 at 2:03 PM, \u674e\u7389\u73cf@163 <18...@163.com> wrote:
>
>> Hi\uff0c
>>
>> When in service grid service execution, if the local node deployment
>> services, will directly call the local deployment service, otherwise it
>> will find the service in the grid.
>>
>> The local service, and the caller will use the same thread, in this case,
>> the two threads\u2018s state is different, that is to say, the same call, have
>> different behavior in different scene, I think the design is not reasonable.
>>
>> For example, a thread local variable is defined, and according to the
>> above description, the value of the same variable may be different for
>> different scenarios.
>>
>>
>>



Re: About thread problem of service execution in Ignite Service Grid

Posted by Valentin Kulichenko <va...@gmail.com>.
Why would you use a thread local in a service? What design you think is
reasonable?

-Val

On Mon, Mar 13, 2017 at 2:03 PM, 李玉珏@163 <18...@163.com> wrote:

> Hi,
>
> When in service grid service execution, if the local node deployment
> services, will directly call the local deployment service, otherwise it
> will find the service in the grid.
>
> The local service, and the caller will use the same thread, in this case,
> the two threads‘s state is different, that is to say, the same call, have
> different behavior in different scene, I think the design is not reasonable.
>
> For example, a thread local variable is defined, and according to the
> above description, the value of the same variable may be different for
> different scenarios.
>
>
>