You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@storm.apache.org by 姚驰 <ya...@163.com> on 2014/10/29 07:52:43 UTC
Is it safe to use a member that is not thread-safe in a bolt or
spout?
As I ran others' examples, I find that some operations in bolt on members not thread-safe occured with lock like "synchronize" while others not,
so if I run a bolt with multi-tasks, will the members in it be shared across these threads? Should I make sure that all members are thread-safe?
Re: Is it safe to use a member that is not thread-safe in a bolt or spout?
Posted by Sean Zhong <cl...@gmail.com>.
On Wed, Oct 29, 2014 at 2:52 PM, 姚驰 <ya...@163.com> wrote:
> bolt on members not thread-safe occured with lock like "synchronize" while
> others not,
> so if I run a bolt with multi-tasks, will the members in it be shared
> across these threads? Should I make sure that all members are thread-safe?
>
>
Hi Yaochi,
Each bolt can have multiple tasks. Each task is represented by an isolated
instance, their member fields are not shared.