CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2010
    Posts
    2

    Sax Parser Exception

    I am creating many xml files and used thread class to create all the pages simultaneously but I am getting sax parser exception, so that pages are not created with required data. I am adding sample code here.

    class PageThread extends Thread
    {
    Content content;

    public createPageThread(Content content)
    {
    this.content = content;
    }

    public void run()
    {
    createPage(content);
    }
    }

    This creatPage(Content) method has many methods.

    I think when more than one thread try to access the same method that time we will get this error but I am not sure, If this is the case then what is the point of using threads?

    Can anyone help me to solve this issue...

  2. #2
    Join Date
    May 2006
    Location
    UK
    Posts
    4,473

    Re: Sax Parser Exception

    Please use code tags when posting code.

    Without the exception message and stack trace and the relevant code it's not possible to say what is going wrong.

    If this is the case then what is the point of using threads?
    The use of threads is often misunderstood and misapplied. If you want to parse 5 files, doing the task on 5 threads probably won't make it any faster and can even make it slower. Multi-threading tasks like this only helps if the processor is the bottle neck and you have multiple processors. If the bottleneck is reading from disk etc multiple threads will not help.

    Where multiple threads help is when you have a time consuming task to perform but you don't want that task to stop other operations from working for example when you save a large file to disk if you don't want the GUI to freeze during the save operation you do the save on a separate thread.
    Posting code? Use code tags like this: [code]...Your code here...[/code]
    Click here for examples of Java Code

  3. #3
    Join Date
    Jun 1999
    Location
    Eastern Florida
    Posts
    3,877

    Re: Sax Parser Exception

    Could you post a link to this site's thread on the other site where you asked this question?
    Norm

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured