|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#16
|
|||
|
|||
|
Re: Suggestion for next year's WPILib
If the auto thread is politely behaved and checking a cancel or other notification, what is the benefit in forking a thread and killing it. It seems to me that the big benefit of killing the thread is to handle code that is spin-locked, yielded, looping to home in on a target, or otherwise not well-behaved.
Statistically, killing the thread will usually work, but if the thread has acquired a mutex, allocated I/O or other other OS resources, how is a chaperone to know what to delete, what to leave open, what to unlock. Plus depending on the implementation, the lock and other items may have thread-local storage, which means the info has been torn down and the chaperone doesn't have the ability to clean up. If enough shadowing is done with WPILib, those resources can be made safe for killing. OS resources would still be an issue, but should be sufficiently rare I'd think. Greg McKaskle |
|
#17
|
||||
|
||||
|
Re: Suggestion for next year's WPILib
Quote:
VxWorks also has public (inter-process) versions of all these types but we don't use them for FIRST (processes are not used, just kernel mode tasks/threads) Hope this helps |
|
#18
|
||||
|
||||
|
Re: Suggestion for next year's WPILib
Quote:
Hope this helps |
|
#19
|
||||
|
||||
|
Re: Suggestion for next year's WPILib
I have a different suggestion for WPILib & WPILibJ:
Make WPILib & WPILibJ as close to the same as possible (and make them make more sense) also, having WPILib and WPILibJ have the same version number would be nice Although I have only looked at the Dashboard and Driverstation classes, they are quite a bit different (and helped cause this error http://www.chiefdelphi.com/forums/sh...2612&page=2#20) 2010: Code:
C++
dash = DriverStation::GetInstance()->GetHighPriorityDashboardPacker();
dash.Printf("%s",data.c_str());//this sends it as well
Java
dash = DriverStation.getInstance().getDashboardPackerHigh();
dash.addString(data);//this does not send it
dash.commit();
Code:
C++
dash = DriverStation::GetInstance()->GetHighPriorityDashboardPacker();
dash.AddString("%s",data.c_str());
dash.Send();
Java
dash = DriverStation.getInstance().getHighPriorityDashboardPacker();
dash.addString(data);
dash.send();
|
|
#20
|
||||
|
||||
|
Re: Suggestion for next year's WPILib
Printf() and AddString() are not the same function. C++ has AddString() too, and a function that does the same thing as commit().
But they should be consistent with naming, I guess. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Next Year's Game? | Robert Cawthon | Rumor Mill | 537 | 30-10-2009 23:46 |
| Next year's game? | petek | Rumor Mill | 111 | 26-04-2008 02:59 |
| Next Year's Robot? | BandChick | General Forum | 10 | 29-03-2006 16:28 |
| New Ideas for next year's competition | XCJP | General Forum | 34 | 10-05-2005 10:07 |
| Great Ideas For Next Year's Game | MikeT | Chit-Chat | 0 | 15-05-2003 23:05 |