Hello On Saturday 09 August 2008 17:23:39 Zeljko Vrba wrote:
Just out of curiosity, why are you rewriting thread-based code into event-based code? It might be easier/cheaper to port[*] it instead to an OS that handles large number of threads better..
Main platform is Linux with secondary Windows platform. The problem right now is not OS threading support but rather the complexity of the program to handle timeouts and errors. With an asynchronous aproach each async operation is also a point of failure or timeout. Thus the points of failure/timeout are basically handled through the normal flow of the code (the code already "breaks" flow and returns on each async operation, timeout is just an event like any). With a synchronous aproach timeout would have to be handled with exceptions or support breaking of flow and return (similar to the asynchronous operation). Also the pure multithreaded aproach imposes locking and thread synchronization where usually there is none needed (since there is no need that certain parts be ran concurrently). This makes the code more error prone and IMO more complex than it needs to be. I supose a compromise solution that combines both threading and asynchronous operation might be the best. -- Dizzy