Note that there are some explanatory texts on larger screens.

plurals
  1. POC++ Class design for Multi threaded application
    primarykey
    data
    text
    <p>I am working on a console application and i would need some suggestions in design. - Priority being, Performance. </p> <p><strong>Class 1</strong></p> <pre><code>Class Get_data_from_Internet{ // Gets data from Internet. // As its html source, the data is stored in a flat file. } </code></pre> <p>This class gets the data from internet using sockets. </p> <p><strong>Class 2</strong></p> <pre><code>Class process_HTML_format_one { // This class processes the data of the HTML file generated above using format ONE. // An example, this format processes HTML text of yahoo.com // Remove all unnecessary HTML Tags. // Extract only the required information. // Fill a structure (struct) with Data. // Update Database. } </code></pre> <p>The above class processes data of a website in a perticular format. </p> <p><strong>Class 3</strong></p> <pre><code>Class process_HTML_format_two { // This class processes the data of the HTML file using format TWO. // An example, this format processes HTML text of MSN.com // Remove all unnecessary HTML Tags. // Extract only the required information. // Fill a structure (struct) with Data. // Update Database. } </code></pre> <p>The above class processes data of website 2 in a predefined format. There are atleast a dozen of such HTML format classes, which would be selected &amp; used as per the URL's. </p> <p><strong>Class 4</strong></p> <pre><code>class start_monitoring { // Get all URL's from DB. (Around 1000 + URL's) // Call "Get_data_from_internet" for each URL. // Process each text file using any of the formats specified/defined above. } </code></pre> <p>The above class retrieves a list of URL's from DB and should process each URL accordingly. </p> <p><strong>Requirement</strong> 1. The Start_monitoring class must process each URL by spawning a thread for each for better performance (to fetch near real time data). (Should it be fine or will it make things worse ? As each thread processes its own data, i think there shouldnt be any issues with this.) 2. Does using C++ threads fine in this case? Because, i cant use POSIX threads as most of the functionality is binded with in individual classes/sub classes. 3. Any other alternatives i should try looking for? </p> <p>Any advice in this regard is highly appreciated. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload