|
Bugzilla – Full Text Bug Listing |
| Summary: | DefaultSimulatorImpl no longer allows scheduling from multiple threads | ||
|---|---|---|---|
| Product: | ns-3 | Reporter: | Gustavo J. A. M. Carneiro <gjcarneiro> |
| Component: | core | Assignee: | Mathieu Lacage <mathieu.lacage> |
| Status: | RESOLVED DUPLICATE | ||
| Severity: | major | CC: | ns-bugs, tomh |
| Priority: | P5 | ||
| Version: | ns-3-dev | ||
| Hardware: | All | ||
| OS: | All | ||
*** This bug has been marked as a duplicate of bug 1410 *** Just a FYI, this is assert is not going away unless you find a safe way to know for sure that ::Run is _really_ not running in another thread so, it would be a good idea to find a better way to do what you want to do in the visualizer. (In reply to comment #3) > Just a FYI, this is assert is not going away unless you find a safe way to know > for sure that ::Run is _really_ not running in another thread so, it would be a > good idea to find a better way to do what you want to do in the visualizer. How about Simulator::Lock() and Simulator::Unlock(), for safe multithreading? It would be trivial to switch pyviz to use that. |
The DefaultSimulatorImpl no longer allows scheduling from multiple threads. It seems to note which is the "main" thread and asserts that only this thread can schedule events. DefaultSimulatorImpl::Schedule (Time const &time, EventImpl *event) { NS_ASSERT_MSG (SystemThread::Equals (m_main), "Simulator::Schedule Thread-unsafe invocation!"); This breaks the visualizer in some cases (namely when you run it from a python simulation script). The visualizer can call Simulator::Schedule from multiple (2) threads, but it use a mutex to make sure only one thread at a time can call the ns-3 API. This assert is excessive. cf. bug 631 comments.