yeh, I see
synchronised (peer) { peer.send(..) } is work
thanks,
-Rong
On Jan 14, 2013, at 11:04 AM, Suraj Menon <[email protected]> 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 <[email protected]>wrote:
>
>> peer.send() is not thread safe
>>
>> On Jan 7, 2013, at 6:39 PM, Edward J. Yoon <[email protected]> wrote:
>>
>>> Oh,
>>>
>>> Sure no problem. ;)
>>>
>>> On Mon, Jan 7, 2013 at 6:59 PM, realstolz.gmail <[email protected]>
>> 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" <[email protected]>
>> 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 <[email protected]>
>> 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
>>
>>