is resourcestring translation thread safe ?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

is resourcestring translation thread safe ?

ik-6
Hello,

Let's say I have a multi-threaded cgi (such as brook framework), and I
use resourcestring to translate strings.
Does the translation of resourcestring will be based on a thread -
that is a copy for each thread, or will it be globally changed ?

Thanks,
Ido
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: is resourcestring translation thread safe ?

Sven Barth-2
On 21.02.2013 17:55, ik wrote:
> Hello,
>
> Let's say I have a multi-threaded cgi (such as brook framework), and I
> use resourcestring to translate strings.
> Does the translation of resourcestring will be based on a thread -
> that is a copy for each thread, or will it be globally changed ?

It's globally. There is one resourcestring table for each unit and this
will be changed through calls to SetResourceStrings (
http://community.freepascal.org/docs-html/rtl/objpas/setresourcestrings.html 
).

Regards,
Sven

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: is resourcestring translation thread safe ?

ik-6
On Thu, Feb 21, 2013 at 8:06 PM, Sven Barth <[hidden email]> wrote:

> On 21.02.2013 17:55, ik wrote:
>>
>> Hello,
>>
>> Let's say I have a multi-threaded cgi (such as brook framework), and I
>> use resourcestring to translate strings.
>> Does the translation of resourcestring will be based on a thread -
>> that is a copy for each thread, or will it be globally changed ?
>
>
> It's globally. There is one resourcestring table for each unit and this will
> be changed through calls to SetResourceStrings (
> http://community.freepascal.org/docs-html/rtl/objpas/setresourcestrings.html
> ).

I know it, but the question is, is it thread safe, so each thread can
translate it differently on the same process at run time ?

>
> Regards,
> Sven
>
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: is resourcestring translation thread safe ?

Sven Barth-2
On 21.02.2013 19:14, ik wrote:

> On Thu, Feb 21, 2013 at 8:06 PM, Sven Barth <[hidden email]> wrote:
>> On 21.02.2013 17:55, ik wrote:
>>>
>>> Hello,
>>>
>>> Let's say I have a multi-threaded cgi (such as brook framework), and I
>>> use resourcestring to translate strings.
>>> Does the translation of resourcestring will be based on a thread -
>>> that is a copy for each thread, or will it be globally changed ?
>>
>>
>> It's globally. There is one resourcestring table for each unit and this will
>> be changed through calls to SetResourceStrings (
>> http://community.freepascal.org/docs-html/rtl/objpas/setresourcestrings.html
>> ).
>
> I know it, but the question is, is it thread safe, so each thread can
> translate it differently on the same process at run time ?

There is one table for each unit in which each resource string of the
unit is located exactly once with one translation. Does this answer your
question?

Regards,
Sven



_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: is resourcestring translation thread safe ?

ik-6
On Thu, Feb 21, 2013 at 9:07 PM, Sven Barth <[hidden email]> wrote:

> On 21.02.2013 19:14, ik wrote:
>>
>> On Thu, Feb 21, 2013 at 8:06 PM, Sven Barth <[hidden email]>
>> wrote:
>>>
>>> On 21.02.2013 17:55, ik wrote:
>>>>
>>>>
>>>> Hello,
>>>>
>>>> Let's say I have a multi-threaded cgi (such as brook framework), and I
>>>> use resourcestring to translate strings.
>>>> Does the translation of resourcestring will be based on a thread -
>>>> that is a copy for each thread, or will it be globally changed ?
>>>
>>>
>>>
>>> It's globally. There is one resourcestring table for each unit and this
>>> will
>>> be changed through calls to SetResourceStrings (
>>>
>>> http://community.freepascal.org/docs-html/rtl/objpas/setresourcestrings.html
>>> ).
>>
>>
>> I know it, but the question is, is it thread safe, so each thread can
>> translate it differently on the same process at run time ?
>
>
> There is one table for each unit in which each resource string of the unit
> is located exactly once with one translation. Does this answer your
> question?

Thanks

>
>
> Regards,
> Sven
>
>
>
> _______________________________________________
> fpc-pascal maillist  -  [hidden email]
> http://lists.freepascal.org/mailman/listinfo/fpc-pascal
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal