Q about multi-thread in NS-3

313 views
Skip to first unread message

Rui Yang

unread,
Oct 18, 2017, 2:00:35 PM10/18/17
to ns-3-users
Hi all,

I have a question about the multithreading in NS3. 

My application case is that, in one node I want to send and receive information simultaneously. Due to that they share some variables, so I'd like to use multithread in one node ( e.g. one run udp-client, one run udp-server.)
To describe it more clearly, I want to create multiple nodes, each node has at least two threads. Then do SystemThread and SytemMutex appropriate to solve this?

(In the SystemThread example 'main-test-sync.cc', the thread is created in an outer way. The background function does not communicate with FakeDevices, which is different from my case.)


Thanks in advance.
-Rui

pdbarnes

unread,
Oct 18, 2017, 11:14:53 PM10/18/17
to ns-3-users
No SystemThread is for the simulator to execute internally on multiple threads.

Just creating and installing multiple Applications on a Node will cause them to *appear* to run in parallel, even if they share some variables.
Peter

Reply all
Reply to author
Forward
0 new messages