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 241285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:44:26+00:00 2026-05-11T20:44:26+00:00

i am running 12 threads .function which these threads are calling is not having

  • 0

i am running 12 threads .function which these threads are calling is not having any lock on some object.but still these threads are taking too much time.(16 minutes).each thread ially parsing a xml document which is running alright if run indiviually.is this problem because of some reason related max no threads provided by express edition or some blocking dn by express edition.


code of func whic each thread calls is given below.
each thread is given different rssfeed(urladdress)

public static class RssFileReader
{
    public static Rss GetRssDocumentData(string rssFeed)
    {
        Console.WriteLine("thread in RssFileReader: " + Thread.CurrentThread.Name);

        IFormatProvider culture = new CultureInfo("fr-FR", true);

        Rss rssDocumentObject=new Rss();
        XmlDocument documentObj = new XmlDocument();
        try
        {
            documentObj.Load(HttpClient.GetWebResponse(@rssFeed, null, null, 1200000, @"http://www.sahil.com").GetResponseStream());
        }
        catch(Exception e)
        {
            e.Source = "RssFileReader:Loading xmldocument object";
            throw;
        }
        try
        {
            XmlNodeList channelList = documentObj.GetElementsByTagName("channel");
            for (int k = 0; k < channelList.Count; k++)
            {

                rssDocumentObject.ListOfChannel.Add(new Channel());
                int noOfItemInChannel = -1;
                //XmlNodeList itemList = channelList[k].ChildNodes;
                for (int i = 0; i < channelList[k].ChildNodes.Count; i++)
                {


                    switch (channelList[k].ChildNodes[i].Name)
                    {

                        case "item":
                            noOfItemInChannel++;
                            XmlNodeList xmlChildNodeOfItem = channelList[k].ChildNodes[i].ChildNodes;
                            //debugging
                            //Console.WriteLine("Thread Name in item in RssFileReader" + Thread.CurrentThread.Name);

                            rssDocumentObject.ListOfChannel[k].ListOfItem.Add(new Item());

                            for (int j = 0; j < xmlChildNodeOfItem.Count; j++)
                            {
                                switch (xmlChildNodeOfItem[j].Name)
                                {
                                    case "title":
                                        rssDocumentObject.ListOfChannel[k].ListOfItem[noOfItemInChannel].ItemTitle.InnerText = xmlChildNodeOfItem[j].InnerText;
                                        break;
                                    case "link":
                                        rssDocumentObject.ListOfChannel[k].ListOfItem[noOfItemInChannel].ItemLink.InnerText = xmlChildNodeOfItem[j].InnerText;
                                        break;
                                    case "description":
                                        rssDocumentObject.ListOfChannel[k].ListOfItem[noOfItemInChannel].ItemDescription.InnerText = xmlChildNodeOfItem[j].InnerText;
                                        break;
                                    case "pubDate":
                                        try
                                        {
                                            string dateTimeTemp = xmlChildNodeOfItem[j].InnerText;
                                            char[] splitCharArray = new char[1];
                                            splitCharArray[0] = ' ';
                                            string[] splitedDateTimeTemp = dateTimeTemp.Split(splitCharArray);
                                            string RFC822 = "ddd,ddMMMyyyyHH:mm:ss";
                                            rssDocumentObject.ListOfChannel[k].ListOfItem[noOfItemInChannel].ItemPubDate.PublicationDate = DateTime.ParseExact(splitedDateTimeTemp[0] + splitedDateTimeTemp[1] + splitedDateTimeTemp[2] + splitedDateTimeTemp[3] + splitedDateTimeTemp[4], RFC822, DateTimeFormatInfo.InvariantInfo, DateTimeStyles.None);
                                        }
                                        //exception not rethrown default date is assigned 
                                        catch (Exception e)
                                        {
                                            //Console.WriteLine("Exception while formatting string to datetime in rssFileReader():" + e);
                                        }
                                        break;
                                    case "guid":
                                        rssDocumentObject.ListOfChannel[k].ListOfItem[noOfItemInChannel].ItemGuid.InnerText = xmlChildNodeOfItem[j].InnerText;
                                        break;


                                }
                            }
                            break;
                        case "title":
                            rssDocumentObject.ListOfChannel[k].ChannelTitle.InnerText = channelList[k].ChildNodes[i].InnerText;
                            break;
                        case "description":
                            rssDocumentObject.ListOfChannel[k].ChannelDescription.InnerText = channelList[k].ChildNodes[i].InnerText;
                            break;
                        case "link":
                            rssDocumentObject.ListOfChannel[k].ChannelLink.InnerText = channelList[k].ChildNodes[i].InnerText;
                            break;

                        case "language":
                            rssDocumentObject.ListOfChannel[k].ChannelLanguage.InnerText = channelList[k].ChildNodes[i].InnerText;
                            break;
                        case "pubDate":
                            try
                            {
                                string dateTimeTempForChannel = channelList[k].ChildNodes[i].InnerText;
                                char[] splitCharArrayForChannel = new char[1];
                                splitCharArrayForChannel[0] = ' ';
                                string[] splitedDateTimeTempForChannel = dateTimeTempForChannel.Split(splitCharArrayForChannel);
                                string formatStringForChannel = "ddd,ddMMMyyyyHH:mm:ss";
                                rssDocumentObject.ListOfChannel[k].ChannelPubDate.PublicationDate = DateTime.ParseExact(splitedDateTimeTempForChannel[0] + splitedDateTimeTempForChannel[1] + splitedDateTimeTempForChannel[2] + splitedDateTimeTempForChannel[3] + splitedDateTimeTempForChannel[4], formatStringForChannel, DateTimeFormatInfo.InvariantInfo, DateTimeStyles.None);
                            }
                            //exception not rethrown default date is assigned 
                            catch (Exception e)
                            {
                                //Console.WriteLine("Exception while formatting string to datetime in rssFileReader():" + e);

                            }
                            break;
                        case "lastBuildDate":
                            try
                            {
                                string dateTimeTempForChannel = channelList[k].ChildNodes[i].InnerText;
                                char[] splitCharArrayForChannel = new char[1];
                                splitCharArrayForChannel[0] = ' ';
                                string formatStringForChannel = "ddd,ddMMMyyyyHH:mm:ss";

                                string[] splitedDateTimeTempForChannel = dateTimeTempForChannel.Split(splitCharArrayForChannel);
                                rssDocumentObject.ListOfChannel[k].ChannelLastBuildDate.LastBldDate = DateTime.ParseExact(splitedDateTimeTempForChannel[0] + splitedDateTimeTempForChannel[1] + splitedDateTimeTempForChannel[2] + splitedDateTimeTempForChannel[3] + splitedDateTimeTempForChannel[4], formatStringForChannel, DateTimeFormatInfo.InvariantInfo, DateTimeStyles.None);
                            }
                            //exception not rethrown default date is assigned 
                            catch (Exception e)
                            {
                                //Console.WriteLine("Exception while formatting string to datetime in rssFileReader():" + e);

                            }

                            break;

                        case "docs":
                            rssDocumentObject.ListOfChannel[k].ChannelDocs.InnerText = channelList[k].ChildNodes[i].InnerText;
                            break;
                        case "generator":
                            rssDocumentObject.ListOfChannel[k].ChannelGenerator.InnerText = channelList[k].ChildNodes[i].InnerText;
                            break;
                        case "managingEditor":
                            rssDocumentObject.ListOfChannel[k].ChannelManagingEditor.InnerText = channelList[k].ChildNodes[i].InnerText;
                            break;
                        case "webMaster":
                            rssDocumentObject.ListOfChannel[k].ChannelWebMaster.InnerText = channelList[k].ChildNodes[i].InnerText;
                            break;
                        case "ttl":
                            rssDocumentObject.ListOfChannel[k].ChannelTtl.InnerText = channelList[k].ChildNodes[i].InnerText;
                            break;

                    }
                }


            }
        }
        catch(Exception e)
        {
            e.Source = "RssFileReader:Reading xml document object data to rss object";
            throw;
        }
        Console.WriteLine("    Thread out RssFilereader :" + Thread.CurrentThread.Name);
        return rssDocumentObject;
    }
}

note:-while debugging i got to know that its taking time while loading xml document.
is there any limit imposed on system for number of webrequest objects?

  • 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-11T20:44:26+00:00Added an answer on May 11, 2026 at 8:44 pm

    it was taking time when i was running it from console applcation fr testing.
    reason fo much time taken was io blocking because of pint statements fr debugging.

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

Sidebar

Ask A Question

Stats

  • Questions 141k
  • Answers 141k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer If you call the bang! form of the transition event… May 12, 2026 at 8:05 am
  • Editorial Team
    Editorial Team added an answer You can use a conversion operator, along with a constructor,… May 12, 2026 at 8:05 am
  • Editorial Team
    Editorial Team added an answer I think an ajax call might suit you best, but… May 12, 2026 at 8:05 am

Related Questions

I am working through some of the exercises in The C++ Programming Language by
I am using the class pasted below to listen for the keypress event ctrl
On Linux under X11 and using GTK+ you have something called Main Loop. Once
I am trying to port a project including both SDL and WxWidgets to MacOS

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.