Is SMC-generated code thread safe?
• C: No. • C++: No. • C#: Yes, if you use the SMC -sync option. • Groovy: Yes, if you use the SMC -sync option. • Java: Yes, if you use the SMC -sync option. • Lua: No. • Perl: No. • PHP: No. • Python: No. • Ruby: No. • Scala: Yes, if you use the SMC -sync option. • Tcl: No. • VB.net: Yes, if you use the SMC -sync option. The -sync command line option used with -java and -vb causes SMC to add the synchronized keyword (Java), SyncLock Me/End SyncLock (VB.net) or lock(this){…} (C#) to the transition methods. Therefore, if a transition has been issued from one thread and a second thread attempts to issue a transition before the first thread’s transition has been completed, then the second thread will be blocked until the current transition returns. There are no plans to generate thread-safe Tcl code. It is up to the developer to guarantee that two separate threads cannot issue overlapping transitions.