On Fri, Apr 29, 2022 at 9:53 AM Henry Rich <[email protected]> wrote: > I think y'all are overdesigning this. Thread creation will probably be > done once, at the start of a session. All you need is a simple primitive > to create one thread with maximum generality. Write a verb to do what > you need.
It's going to go at the start of every implementation of an algorithm which uses threading. Assuming we are able to implement any algorithms where threading provides a significant performance increase. And, modular design says that we are going to have multiple instances of those. The problems we're going to be solving here include figuring out how many threads are optimal, for that algorithm, for a specific machine. Number of cores seems like a good approximation, but locking overhead may change that. (Another problem we're going to be solving here is figuring out how to deal with overlapping use of different algorithms which use threading. The simple solution (completely finish one before starting another) will inevitably run into people wanting to do things more efficiently.) That said, ... designing things based on future requirements rather than current requirements is what gets us into overdesign. And, the current requirement is: we want to be running Y threads, where Y is the number of physical cpu cores on the machine. I think you're saying that you plan on providing library support, so that the useful operations will not have to be re-implemented, and that typical case use, outside of classroom presentation, will not use this primitive. But if that's the case... I'm not sure why threading wasn't built using foreigns. -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
