[Ndn-lib] is jNDN thread-safe
philoliang at email.arizona.edu
Thu Jun 8 15:35:31 PDT 2017
The current implementation is not on Android, but we do plan to deploy
it on Android later.
In my scenario, each node is running an NFD with an NDN consumer and
producer. Can they use the same face to communicate with the local NFD?
If they are using two different faces, the local producer can answer the
Interest from the local consumer, which affects the design. For the
implementation, I try to run the consumer and producer on different
threads in the same class.
On 6/7/17 11:31 PM, Thompson, Jeff wrote:
> .. I should ask? Are you using jNDN on Android or not?
> From: Jeff Thompson <jefft0 at remap.ucla.edu <mailto:jefft0 at remap.ucla.edu>>
> Date: Wednesday, June 7, 2017 at 23:30:00
> To: Teng Liang <philoliang at email.arizona.edu
> <mailto:philoliang at email.arizona.edu>>, NDN Lib
> <ndn-lib at lists.cs.ucla.edu <mailto:ndn-lib at lists.cs.ucla.edu>>
> Subject: Re: [Ndn-lib] is jNDN thread-safe
> Hi Teng,
> There are two ways to handle thread safety:
> If you are using the Face class, then your application must call
> processEvents in the same thread as it calls expressInterest. Some
> more details are here:
> Or you can use ThreadPoolFace
> which automatically submits calls to expressInterest to the thread
> pool, and wraps callbacks (like onData) so that they are thread safe.
> Also, ThreadPoolFace can use AsyncTcpTransport
> with the same thread pool so that your application doesn’t need to
> call processEvents at all. See the example application
> - Jeff T
> On 2017/6/7, 17:46:14, "Ndn-lib on behalf of Teng Liang"
> <ndn-lib-bounces at lists.cs.ucla.edu
> <mailto:ndn-lib-bounces at lists.cs.ucla.edu> on behalf of
> philoliang at email.arizona.edu <mailto:philoliang at email.arizona.edu>> wrote:
> Hello all,
> Is jNDN thread-safe? Specifically, can one thread express
> Interests to
> one face, while another thread uses the same face to process events?
> Ndn-lib mailing list
> Ndn-lib at lists.cs.ucla.edu <mailto:Ndn-lib at lists.cs.ucla.edu>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Ndn-lib