develooper Front page | perl.perl6.users | Postings from September 2017

Re: thread behavior

Thread Previous | Thread Next
From:
JuhiMarcel LangbroekTimmerman
Date:
September 4, 2017 08:44
Subject:
Re: thread behavior
Message ID:
15e4c1024c0.27a2.c4d70481b56e4b3aae118c5c5573c3fe@gmail.com
Hi liz,

Thanks for your anwer. I assume there are a few things I can rely on;
- the main thread is where the code starts and will always have id 1
- a continuation of statements/blocks will always be excecuted on the same 
thread except for those hyper thingies which are again separate blocks or 
closures excecuted on other threads

Is that correct?

Greetings,
Marcel



On September 4, 2017 09:58:40 Elizabeth Mattijsen <liz@dijkmat.nl> wrote:

>> On 4 Sep 2017, at 09:29, Marcel Timmerman <mt1957@gmail.com> wrote:
>> I was wondering about the following,
>>
>> When an Exception is thrown in a thread and is CATCHed  in another object, 
>> will that block be run in the same thread as the Exception is thrown?
>
> I think from 6.d onward, you can not rely on your code being executed in 
> any specific thread, especially when using await(), but possibly more 
> generally in the future.
>
> So it feels like a premature optimisation depending on your code being 
> executed by the same thread in *any* situation, but especially in the light 
> of control exceptions.
>
>
> Hope this is a useful answer  :-)
>
>
>
> Liz

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About