Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 284931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:30:02+00:00 2026-05-12T05:30:02+00:00

I am currently working on an application that parses huge XML files. For each

  • 0

I am currently working on an application that parses huge XML files.

For each file, there will be different processes but all of them will be parsed into a single object model.

Currently, the objects parsed from each XML file will go into a single collection.

This collection is also used during parsing, e.g. if a similar object already exists, it will modify the object’s property instead, such as adding count.

Looking at the CPU graph when this application is running, it is clear that it only uses part of the CPU (one core at a time on 100%), so I assume that running it on parallel will help shave running time.

I am new into parallel programming, so any help is appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T05:30:02+00:00Added an answer on May 12, 2026 at 5:30 am

    I would suggest you the following technique: construct a queue of objects that wait to be processed and dequeue them from multiple threads:

    1. Create an XmlReader and start reading the file node by node while not EOF.
    2. Once you encounter a closing tag you can serialize the contents it into an object.
    3. Put the serialized object into a Queue.
    4. Verify the number of objects in the Queue and if it is bigger than N, kick a new thread from the ThreadPool which will dequeue <= N objects from the queue and process them.

    The access to the queue needs to be synchronized because you will enqueue and dequeue objects from multiple threads.

    The difficulty consists in finding N such that all the CPU cores work at the same time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently I'm working on an application that has to parse a large XML file
We are currently working on an application that will use a WCF service. The
I am currently working on a web application that uses PHP and MySQL, but
I'm currently working on a Flash application that needs to save files to Drupal.
I am working towards producing a small application that parses XML from a URL
In an application that I am currently working on, a requirement is to bring
A database application that I'm currently working on, stores all sorts of settings in
I am currently working on an web application that uses ASP.NET 2.0 framework. I
I'm working on a PyGTK/glade application that currently has 16 windows/dialogs and is about
I am currently working on an application that pulls Google Map locations from an

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.