[quote=NoHaikuForMe][quote=Earl Colby Pottinger]
Can you point to example of a piece of software so poor written that is presently so written for HAIKU?
[/quote]
I only have time for a brief example, there is plenty of other stuff that needs doing
So, take a look at the ImageCache class in ShowImage. This class defines a variable fMaxThreadCount which controls how many threads may be used by image loader workers. To decide a value for the variable ShowImage proceeds by creating a structure on the stack and calling get_system_info, a macro which eventually expands to the Haiku system call _get_system_info()
If B_MAX_CPU_COUNT is changed, the structure size doesn’t match and this results in _get_system_info() returning immediately with an error code. ImageCache doesn’t check, it presumes that the structure is now valid, and it initialises fMaxThreadCount based on the (garbage) contents of the structure. This can mean ShowImage begins trying to use thousands or even millions of threads on a modest home PC.
This problem is inherited from BeOS. Because Haiku has yet to define its own APIs to replace those from BeOS this is a distinction without a difference.[/quote]
Okay, I took a look the programs and the struct to see the cause of the problem.
First, I have a major headache from banging my head against the wall once I realize the mistake made in BeOS! If the CPU-INFO array was at the end of the struct there would be no problem as all the other variables were in effect fixed in size.
Then there is the programs:
Bsnow! Really? Base the timing of the program by using the CPU speed found in this structure? Not only does it not needed to have multiple threads the clock rate of a CPU is not a good basis to calculating speed of your display. If instead they used the sleep_until() or even just sleep() functions they would have gotten the same timing control. Bad programmer - very bad programmer.
DiskProbe! Yep a victim of the bad structure since it uses this struct to get how much memory is available.
ShowImage hurts. Same problem as Diskprobe, I see why you say this is a problem for old Haiku/BeOS programs. Problem is how to break the log-jam.
I see three diffirent solutions, and all have their bad points. But to get out of this log-jam something has to break or a bad kludge will need to be added.
All the choices leave a bad taste in my mouth but for cleanness of code it looks like this struct must be re-ordered even changed to replace the CPU array with a pointer to an array else in memory so it can be any size needed.
What a mess because someone did not think users would have more than 8 CPUs! Ha, Intel already has a design for 256 CPUs on a chip and you can already buy off-the-shelf server designs with 16 or more CPUs (especially if you include hyper-threaded designs).
Again, what a mess!