![]() |
Questions on WPILib components thread usage
Hello, my team has just started programming in java, and we've studied the documentation of WPILib, however some of us still have questions regarding thread safety and thread usage of WPILib's components.
What, if any, components of WPILib use threads? (Not including java's native thread library) Does the VM on the cRio do any sort of automatic background threading or threading without the explicit usage of thread objects, in such a way that we would need to ensure the thread safety of our code? |
Re: Questions on WPILib components thread usage
Yes, all screw holes are threaded.
|
Re: Questions on WPILib components thread usage
Um, excuse me? Chiller, could you clarify?
|
Re: Questions on WPILib components thread usage
Digging through the WPILIBJ source code, I can see a couple of threads created, but only for minor asynchronous communication. Preferences, for instance, are saved and retrieved in a separate thread. Some of the networktable methods manage connections in separate threads.
The actual robot code seems to run entirely in a single thread. Thread-safety is a good topic to discuss and an important discipline to remember, but I think that it will not be an issue in your robot code. |
Re: Questions on WPILib components thread usage
Thanks for the information krieck. It's one less thing for our team to worry about. What about the command system? One would think that to run commands synchronously, they would be run in a seperate thread?
|
Re: Questions on WPILib components thread usage
Quote:
However, there is a downside because if one of your commands calls sleep or whatnot in its execute method, then all the other commands will have to wait for yours to finish before they do anything. |
Re: Questions on WPILib components thread usage
Quote:
|
Re: Questions on WPILib components thread usage
Quote:
|
| All times are GMT -5. The time now is 22:22. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi