<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">More detailed explanation:<div class=""><br class=""></div><div class="">Some people have been working on that:</div><div class=""><br class=""></div><div class=""><a href="http://mailman.isi.edu/pipermail/ns-developers/2009-July/006197.html" class="">http://mailman.isi.edu/pipermail/ns-developers/2009-July/006197.html</a></div><div class=""><a href="https://www.nsnam.org/doxygen/classns3_1_1_system_thread.html" class="">https://www.nsnam.org/doxygen/classns3_1_1_system_thread.html</a></div><div class=""><br class=""></div><div class="">However, when you have a simulation scenario and you do Simulator::Run, the thread that handles this operation will have an event queue, where all events will be scheduled and the ns3 library maintains global state. Even if you manage to make it work, all the threads will access the same shared state and data (and most probably the output of the simulation will not make sense):</div><div class=""><br class=""></div><div class=""><a href="http://stackoverflow.com/questions/35543906/parallel-simulations-using-ns3-and-stdthread" class="">http://stackoverflow.com/questions/35543906/parallel-simulations-using-ns3-and-stdthread</a></div><div class=""><br class=""></div><div class="">So, overall, while it might be possible, it is not recommended, since you have to partition the accessed memory and the data on your own:</div><div class=""><br class=""></div><div class=""><a href="https://www.nsnam.org/workshops/wns3-2010/parallelization.pdf" class="">https://www.nsnam.org/workshops/wns3-2010/parallelization.pdf</a></div><div class=""><br class=""></div><div class=""><div class="">
<div class=""><div class=""><div class=""><span class="" style="float: none; display: inline !important;">Spyridon (Spyros) Mastorakis</span><br class=""><span class="" style="float: none; display: inline !important;">Personal Website: </span><a href="http://cs.ucla.edu/~mastorakis/" class="">http://cs.ucla.edu/~mastorakis/</a><br class=""><span class="" style="float: none; display: inline !important;">Internet Research Laboratory</span><br class=""><span class="" style="float: none; display: inline !important;">Computer Science Department</span><br class=""><span class="" style="float: none; display: inline !important;">UCLA</span></div><div class=""><span class="" style="float: none; display: inline !important;"><br class=""></span></div></div></div><div class=""><br class=""></div></div><div><blockquote type="cite" class=""><div class="">On Oct 20, 2016, at 10:16 AM, Spyridon (Spyros) Mastorakis <<a href="mailto:mastorakis@cs.ucla.edu" class="">mastorakis@CS.UCLA.EDU</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Anil,<div class=""><br class=""></div><div class="">unfortunately, NS3 is single threaded and is based on scheduling and executing events….</div><div class=""><br class=""></div><div class="">I do not think that something like that is possible. You can use MPI to parallelize simulations, but this is just for performance optimization purposes.</div><div class=""><br class=""></div><div class="">Hope that this helps.</div><div class=""><br class=""><div class="">
<div class=""><div class=""><div class=""><span class="" style="float: none; display: inline !important;">Spyridon (Spyros) Mastorakis</span><br class=""><span class="" style="float: none; display: inline !important;">Personal Website: </span><a href="http://cs.ucla.edu/~mastorakis/" class="">http://cs.ucla.edu/~mastorakis/</a><br class=""><span class="" style="float: none; display: inline !important;">Internet Research Laboratory</span><br class=""><span class="" style="float: none; display: inline !important;">Computer Science Department</span><br class=""><span class="" style="float: none; display: inline !important;">UCLA</span></div><div class=""><span class="" style="float: none; display: inline !important;"><br class=""></span></div></div></div><div class=""><br class=""></div></div><div class=""><blockquote type="cite" class=""><div class="">On Oct 20, 2016, at 10:13 AM, Anil Jangam <<a href="mailto:anilj.mailing@gmail.com" class="">anilj.mailing@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi.<div class=""><br class=""></div><div class="">Is there any special care to be taken while porting an already written multithreaded application into ndnSIM? </div><div class=""><br class=""></div><div class="">I did not find any specific mention of it in the guide here:</div><div class=""><a href="http://ndnsim.net/2.1/guide-to-simulate-real-apps.html" class="">http://ndnsim.net/2.1/guide-to-simulate-real-apps.html</a><br class=""></div><div class=""><br class=""></div><div class="">/anil.</div></div></div></blockquote></div></div></div><br class=""></div></blockquote></div><br class=""></div></body></html>