multithreading - C++ Class design for Multi threaded application -
i working on console application , need suggestions in design. - priority being, performance.
class 1
class get_data_from_internet{ // gets data internet. // html source, data stored in flat file. }
this class gets data internet using sockets.
class 2
class process_html_format_one { // class processes data of html file generated above using format one. // example, format processes html text of yahoo.com // remove unnecessary html tags. // extract required information. // fill structure (struct) data. // update database. }
the above class processes data of website in perticular format.
class 3
class process_html_format_two { // class processes data of html file using format two. // example, format processes html text of msn.com // remove unnecessary html tags. // extract required information. // fill structure (struct) data. // update database. }
the above class processes data of website 2 in predefined format. there atleast dozen of such html format classes, selected & used per url's.
class 4
class start_monitoring { // url's db. (around 1000 + url's) // call "get_data_from_internet" each url. // process each text file using of formats specified/defined above. }
the above class retrieves list of url's db , should process each url accordingly.
requirement 1. start_monitoring class must process each url spawning thread each better performance (to fetch near real time data). (should fine or make things worse ? each thread processes own data, think there shouldnt issues this.) 2. using c++ threads fine in case? because, cant use posix threads of functionality binded in individual classes/sub classes. 3. other alternatives should try looking for?
any advice in regard highly appreciated.
Comments
Post a Comment