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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T22:02:56+00:00 2026-05-11T22:02:56+00:00

In fact, this is the same question as this post: How can I make

  • 0

In fact, this is the same question as this post:

How can I make sure my LINQ queries execute when called in my DAL, not in a delayed fashion?

But since he didn’t explain why he wanted it, the question seems to have been passed over a bit. Here’s my similar-but-better-explained problem:

I have a handful of threads in two types (ignoring UI threads for a moment). There’s a “data-gathering” thread type, and a “computation” thread type. The data gathering threads are slow. There’s a quite a bit of data to be sifted through from a variety of places. The computation threads are comparatively fast. The design model up to this point is to send data-gathering threads off to find data, and when they’re complete pass the data up for computation.

When I coded my data gathering in Linq I wound up hoisting some of that slowness back into my computation threads. There are now data elements that aren’t getting resolved completely until they’re used during computation — and that’s a problem.

I’d like to force Linq to finish its work at a given time (end of statement? end of method? “please finish up, dammit” method call) so that I know I’m not paying for it later on. Adding “.ToList()” to the end of the Linq is 1. awkward, and 2. feels like boxing something that’s about to be unboxed in another thread momentarily anyway.

  • 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-11T22:02:57+00:00Added an answer on May 11, 2026 at 10:02 pm

    You wouldn’t be boxing anything – you’d be buffering the results.

    Using ToList() is basically the way to go if you actually want the data. Unless you’re ready to use the data immediately, it’s got to be buffered somewhere, hasn’t it? A list is just a convenient way to do that.

    The alternative is to do the processing then and there as well – use the data as you produce it, eagerly. I didn’t quite follow the different threads side of thing, so it’s not clear to me whether that would help you, but those are basically the choices available to you as far as I can see.

    This is actually somewhat explicit in your description:

    The design model up to this point is
    to send data-gathering threads off to
    find data, and when they’re complete
    pass the data up for computation.

    Calling ToList() basically changes what you return from “a query which can fetch the data when asked to” to “the data itself, buffered in a list”.

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

Sidebar

Ask A Question

Stats

  • Questions 154k
  • Answers 154k
  • 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 I am happy with my new solution... I use a… May 12, 2026 at 10:25 am
  • Editorial Team
    Editorial Team added an answer The error you're getting is because there's no match in… May 12, 2026 at 10:25 am
  • Editorial Team
    Editorial Team added an answer To get this to work, you simply need to assign… May 12, 2026 at 10:25 am

Related Questions

I've actually asked about this already in this post although we've gone back to
Recently I have been studying recursion; how to write it, analyze it, etc. I
I had been happily coding along on a decent sized solution (just over 13k
Since I started learning F# and OCaml last year, I've read a huge number

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.