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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:04:23+00:00 2026-06-05T07:04:23+00:00

Currently working on a multi-threaded WP 7.1.1 application and slightly more than half of

  • 0

Currently working on a multi-threaded WP 7.1.1 application and slightly more than half of the time the application quits during the “initial phase” without throwing any Exception. It simply ends with all threads returning 0x0 and without entering any Closing/Exit/Quit events.

...
The thread '<No Name>' (0xfde00d2) has exited with code 0 (0x0).
The thread '<No Name>' (0xe860116) has exited with code 0 (0x0).
The thread '<No Name>' (0xfdf00c6) has exited with code 0 (0x0).
The thread '<No Name>' (0xf8d012e) has exited with code 0 (0x0).
The thread '<No Name>' (0xfd5010e) has exited with code 0 (0x0).
The thread '<No Name>' (0xfbc011a) has exited with code 0 (0x0).
The thread '<No Name>' (0xf9900ee) has exited with code 0 (0x0).
The program '[268042506] UI Task: Managed' has exited with code 0 (0x0).
EOL 

What does “initial phase” mean exactly? I profiled the app with “Windows Phone Performance Analysis” and together with some debug messages and some logging I estimate it is approximately 3-4 seconds after the start. At his point the GUI is already visible for a very brief amount of time.

I’m almost certain that the problem occurs duo to the following call:

private static List<MyEntries> EntriesLoad()
{
    using(var context = Context.ReadOnly) // <- works
    {
        return context.MyEntries.Where(m => !m.Deleted).OrderBy(m => m.Name).ToList(); // <- problem
    }
}

private async void EntriesReload()
{
    EntriesLoaded = false; // <- called
    var entries = await TaskEx.Run<List<MyEntries>>(EntriesLoad); // <- called
    EntriesLoaded = true; // <- only get's called 50% of the time/ otherwise app quits
}

To prevent any multithreading issues with the DataContext, a new context is created on each call:

public static Context ReadOnly 
{
    get { return new Context(ConnectionReadOnly); }
}

I even tried BackgroundWorker and ThreadPool instead of the Async CTP 3, but with the same effect. I know very similiar questions have been been asked many times before, but I simply couldn’t find any solution as of yet to my problem. Is there any way/ program I could find the exact method (reason, loc) that is causing the exception? Are there maybe any limits on how many threads can be created? Can DataContext be safely used in this manner?

Your help is much 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-06-05T07:04:25+00:00Added an answer on June 5, 2026 at 7:04 am

    Thank you Stephen for you reply. I was still unable to catch any exception with your proposed changes, however, your answer helped me to better understand what is going on behind the curtain. So thanks again for that.

    I finally managed to get rid of all the “silent” exceptions that caused the application to – almost half the time – quit randomly shortly after the start. To my surprise it was perhaps not caused by any code of mine, but could be originated in the DataContext class. How come? In my application I have been using two different connection strings:

    /* with DeferredLoadingEnabled = false; ObjectTrackingEnabled = true; */
    private const string Connection = "Data Source=isostore:/MyDatabase.sdf;max buffer size=1024;max database size=512;";
    
    /* with DeferredLoadingEnabled = false; ObjectTrackingEnabled = false; */
    private const string ConnectionReadOnly = Connection + "File Mode = read only;";
    

    The exceptions only occured during (and not after, before or while assigning return values) read opperations on a DataContext that used the ReadOnly connection string. Getting rid of the ReadOnly property, and not changing a single other line of code, solved my problems completely. So maybe there is a threading issue in DataContext or in one of the libraries? I can’t really judge the performance impact of abstaining from ReadOnly connections, but since I’m only retrieving a small amount of data and I’m using DataContext in a very atomic-manner, I don’t mind a possible overhead in my particular use case.

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

Sidebar

Related Questions

I'm currently working on a multi-threaded application, and I occasionally receive a concurrently modification
I have a multi-threaded Delphi 6 Pro application that I am currently working on
I'm currently working on a multi-threaded application that would be deployed on arm and
I am currently working on a multi-threaded game application for the Android platform... so
I'm working on a multi-threaded Qt application and would like to connect a signal
I'm currently working on a multi-tenant application that employs Shared DB/Shared Schema approach. IOW,
I'm working on a multi-threaded C# Windows application that makes frequent calls into a
I am currently working on a multi window application that spans over multiple screens.
I am working on a multi-threaded application. This application started out as a single
i'm working with a multi-threaded program (using pthreads) that currently create a background thread

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.