You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hama.apache.org by "realstolz.gmail" <re...@gmail.com> on 2013/01/07 10:01:55 UTC

Concurrently send and receive message

I would like to know whether the message manager used by hama (distributed version) 
supports concurrently send and receive messages?
Is it safe to concurrently call peer.send() and peer.getCurrentMessage() by multiple threads 
in distributed version?

(BTW: I think the default setting for distributed version of message manager is HadoopMessageManagerImpl. Is it right?)
 
thanks,
-Rong


Re: Concurrently send and receive message

Posted by "realstolz.gmail" <re...@gmail.com>.
yeh, I see

synchronised (peer) { peer.send(..) }  is work

thanks,
-Rong


On Jan 14, 2013, at 11:04 AM, Suraj Menon <su...@apache.org> wrote:

> Hi, sorry, both send and receive is not guaranteed to be thread-safe.
> Making them thread-safe could be made configurable in future. But keeping
> them thread safe by default would be costly.
> 
> On Sun, Jan 13, 2013 at 8:53 PM, realstolz.gmail <re...@gmail.com>wrote:
> 
>> peer.send() is not thread safe
>> 
>> On Jan 7, 2013, at 6:39 PM, Edward J. Yoon <ed...@apache.org> wrote:
>> 
>>> Oh,
>>> 
>>> Sure no problem. ;)
>>> 
>>> On Mon, Jan 7, 2013 at 6:59 PM, realstolz.gmail <re...@gmail.com>
>> wrote:
>>>> hi, Edward
>>>> 
>>>> Thank for your reply~
>>>> 
>>>> Sorry for my confusing expression.
>>>> My real question is
>>>> 1. Is it safe to concurrently send messages by multiple threads using
>> the same peer in one superstep (before calling sync())
>>>> 2. Is it safe to concurrently receive messages by multiple threads
>> using the same peer in one superstep (after calling sync())
>>>> 
>>>> not the interleave between send and receive operation, they are
>> independent questions.
>>>> 
>>>> //In fact, I want use multithread in one peer process, but I'm not sure
>> whether the current message manager is concurrently sate
>>>> 
>>>> 
>>>> thanks,
>>>> -Rong
>>>> 
>>>> On Jan 7, 2013, at 5:45 PM, "Edward J. Yoon" <ed...@apache.org>
>> wrote:
>>>> 
>>>>> Nope, BSP tasks are synchronized by exchanging messages at barrier
>>>>> synchronization step. It means that you should call sync() method
>>>>> between send and getCurrentMessage().
>>>>> 
>>>>>> (BTW: I think the default setting for distributed version of message
>> manager is HadoopMessageManagerImpl. Is it right?)
>>>>> 
>>>>> Yes.
>>>>> 
>>>>> On Mon, Jan 7, 2013 at 6:01 PM, realstolz.gmail <re...@gmail.com>
>> wrote:
>>>>>> I would like to know whether the message manager used by hama
>> (distributed version)
>>>>>> supports concurrently send and receive messages?
>>>>>> Is it safe to concurrently call peer.send() and
>> peer.getCurrentMessage() by multiple threads
>>>>>> in distributed version?
>>>>>> 
>>>>>> (BTW: I think the default setting for distributed version of message
>> manager is HadoopMessageManagerImpl. Is it right?)
>>>>>> 
>>>>>> thanks,
>>>>>> -Rong
>>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> --
>>>>> Best Regards, Edward J. Yoon
>>>>> @eddieyoon
>>>> 
>>> 
>>> 
>>> 
>>> --
>>> Best Regards, Edward J. Yoon
>>> @eddieyoon
>> 
>> 


Re: Concurrently send and receive message

Posted by Suraj Menon <su...@apache.org>.
Hi, sorry, both send and receive is not guaranteed to be thread-safe.
Making them thread-safe could be made configurable in future. But keeping
them thread safe by default would be costly.

On Sun, Jan 13, 2013 at 8:53 PM, realstolz.gmail <re...@gmail.com>wrote:

> peer.send() is not thread safe
>
> On Jan 7, 2013, at 6:39 PM, Edward J. Yoon <ed...@apache.org> wrote:
>
> > Oh,
> >
> > Sure no problem. ;)
> >
> > On Mon, Jan 7, 2013 at 6:59 PM, realstolz.gmail <re...@gmail.com>
> wrote:
> >> hi, Edward
> >>
> >> Thank for your reply~
> >>
> >> Sorry for my confusing expression.
> >> My real question is
> >> 1. Is it safe to concurrently send messages by multiple threads using
> the same peer in one superstep (before calling sync())
> >> 2. Is it safe to concurrently receive messages by multiple threads
> using the same peer in one superstep (after calling sync())
> >>
> >> not the interleave between send and receive operation, they are
> independent questions.
> >>
> >> //In fact, I want use multithread in one peer process, but I'm not sure
> whether the current message manager is concurrently sate
> >>
> >>
> >> thanks,
> >> -Rong
> >>
> >> On Jan 7, 2013, at 5:45 PM, "Edward J. Yoon" <ed...@apache.org>
> wrote:
> >>
> >>> Nope, BSP tasks are synchronized by exchanging messages at barrier
> >>> synchronization step. It means that you should call sync() method
> >>> between send and getCurrentMessage().
> >>>
> >>>> (BTW: I think the default setting for distributed version of message
> manager is HadoopMessageManagerImpl. Is it right?)
> >>>
> >>> Yes.
> >>>
> >>> On Mon, Jan 7, 2013 at 6:01 PM, realstolz.gmail <re...@gmail.com>
> wrote:
> >>>> I would like to know whether the message manager used by hama
> (distributed version)
> >>>> supports concurrently send and receive messages?
> >>>> Is it safe to concurrently call peer.send() and
> peer.getCurrentMessage() by multiple threads
> >>>> in distributed version?
> >>>>
> >>>> (BTW: I think the default setting for distributed version of message
> manager is HadoopMessageManagerImpl. Is it right?)
> >>>>
> >>>> thanks,
> >>>> -Rong
> >>>>
> >>>
> >>>
> >>>
> >>> --
> >>> Best Regards, Edward J. Yoon
> >>> @eddieyoon
> >>
> >
> >
> >
> > --
> > Best Regards, Edward J. Yoon
> > @eddieyoon
>
>

Re: Concurrently send and receive message

Posted by "realstolz.gmail" <re...@gmail.com>.
peer.send() is not thread safe

On Jan 7, 2013, at 6:39 PM, Edward J. Yoon <ed...@apache.org> wrote:

> Oh,
> 
> Sure no problem. ;)
> 
> On Mon, Jan 7, 2013 at 6:59 PM, realstolz.gmail <re...@gmail.com> wrote:
>> hi, Edward
>> 
>> Thank for your reply~
>> 
>> Sorry for my confusing expression.
>> My real question is
>> 1. Is it safe to concurrently send messages by multiple threads using the same peer in one superstep (before calling sync())
>> 2. Is it safe to concurrently receive messages by multiple threads using the same peer in one superstep (after calling sync())
>> 
>> not the interleave between send and receive operation, they are independent questions.
>> 
>> //In fact, I want use multithread in one peer process, but I'm not sure whether the current message manager is concurrently sate
>> 
>> 
>> thanks,
>> -Rong
>> 
>> On Jan 7, 2013, at 5:45 PM, "Edward J. Yoon" <ed...@apache.org> wrote:
>> 
>>> Nope, BSP tasks are synchronized by exchanging messages at barrier
>>> synchronization step. It means that you should call sync() method
>>> between send and getCurrentMessage().
>>> 
>>>> (BTW: I think the default setting for distributed version of message manager is HadoopMessageManagerImpl. Is it right?)
>>> 
>>> Yes.
>>> 
>>> On Mon, Jan 7, 2013 at 6:01 PM, realstolz.gmail <re...@gmail.com> wrote:
>>>> I would like to know whether the message manager used by hama (distributed version)
>>>> supports concurrently send and receive messages?
>>>> Is it safe to concurrently call peer.send() and peer.getCurrentMessage() by multiple threads
>>>> in distributed version?
>>>> 
>>>> (BTW: I think the default setting for distributed version of message manager is HadoopMessageManagerImpl. Is it right?)
>>>> 
>>>> thanks,
>>>> -Rong
>>>> 
>>> 
>>> 
>>> 
>>> --
>>> Best Regards, Edward J. Yoon
>>> @eddieyoon
>> 
> 
> 
> 
> -- 
> Best Regards, Edward J. Yoon
> @eddieyoon


Re: Concurrently send and receive message

Posted by "Edward J. Yoon" <ed...@apache.org>.
Oh,

Sure no problem. ;)

On Mon, Jan 7, 2013 at 6:59 PM, realstolz.gmail <re...@gmail.com> wrote:
> hi, Edward
>
> Thank for your reply~
>
> Sorry for my confusing expression.
> My real question is
> 1. Is it safe to concurrently send messages by multiple threads using the same peer in one superstep (before calling sync())
> 2. Is it safe to concurrently receive messages by multiple threads using the same peer in one superstep (after calling sync())
>
> not the interleave between send and receive operation, they are independent questions.
>
> //In fact, I want use multithread in one peer process, but I'm not sure whether the current message manager is concurrently sate
>
>
> thanks,
> -Rong
>
> On Jan 7, 2013, at 5:45 PM, "Edward J. Yoon" <ed...@apache.org> wrote:
>
>> Nope, BSP tasks are synchronized by exchanging messages at barrier
>> synchronization step. It means that you should call sync() method
>> between send and getCurrentMessage().
>>
>>> (BTW: I think the default setting for distributed version of message manager is HadoopMessageManagerImpl. Is it right?)
>>
>> Yes.
>>
>> On Mon, Jan 7, 2013 at 6:01 PM, realstolz.gmail <re...@gmail.com> wrote:
>>> I would like to know whether the message manager used by hama (distributed version)
>>> supports concurrently send and receive messages?
>>> Is it safe to concurrently call peer.send() and peer.getCurrentMessage() by multiple threads
>>> in distributed version?
>>>
>>> (BTW: I think the default setting for distributed version of message manager is HadoopMessageManagerImpl. Is it right?)
>>>
>>> thanks,
>>> -Rong
>>>
>>
>>
>>
>> --
>> Best Regards, Edward J. Yoon
>> @eddieyoon
>



-- 
Best Regards, Edward J. Yoon
@eddieyoon

Re: Concurrently send and receive message

Posted by "realstolz.gmail" <re...@gmail.com>.
hi, Edward

Thank for your reply~

Sorry for my confusing expression.
My real question is 
1. Is it safe to concurrently send messages by multiple threads using the same peer in one superstep (before calling sync())
2. Is it safe to concurrently receive messages by multiple threads using the same peer in one superstep (after calling sync())

not the interleave between send and receive operation, they are independent questions.

//In fact, I want use multithread in one peer process, but I'm not sure whether the current message manager is concurrently sate


thanks,
-Rong

On Jan 7, 2013, at 5:45 PM, "Edward J. Yoon" <ed...@apache.org> wrote:

> Nope, BSP tasks are synchronized by exchanging messages at barrier
> synchronization step. It means that you should call sync() method
> between send and getCurrentMessage().
> 
>> (BTW: I think the default setting for distributed version of message manager is HadoopMessageManagerImpl. Is it right?)
> 
> Yes.
> 
> On Mon, Jan 7, 2013 at 6:01 PM, realstolz.gmail <re...@gmail.com> wrote:
>> I would like to know whether the message manager used by hama (distributed version)
>> supports concurrently send and receive messages?
>> Is it safe to concurrently call peer.send() and peer.getCurrentMessage() by multiple threads
>> in distributed version?
>> 
>> (BTW: I think the default setting for distributed version of message manager is HadoopMessageManagerImpl. Is it right?)
>> 
>> thanks,
>> -Rong
>> 
> 
> 
> 
> -- 
> Best Regards, Edward J. Yoon
> @eddieyoon


Re: Concurrently send and receive message

Posted by "Edward J. Yoon" <ed...@apache.org>.
Nope, BSP tasks are synchronized by exchanging messages at barrier
synchronization step. It means that you should call sync() method
between send and getCurrentMessage().

> (BTW: I think the default setting for distributed version of message manager is HadoopMessageManagerImpl. Is it right?)

Yes.

On Mon, Jan 7, 2013 at 6:01 PM, realstolz.gmail <re...@gmail.com> wrote:
> I would like to know whether the message manager used by hama (distributed version)
> supports concurrently send and receive messages?
> Is it safe to concurrently call peer.send() and peer.getCurrentMessage() by multiple threads
> in distributed version?
>
> (BTW: I think the default setting for distributed version of message manager is HadoopMessageManagerImpl. Is it right?)
>
> thanks,
> -Rong
>



-- 
Best Regards, Edward J. Yoon
@eddieyoon