Paul Wheeler

San Francisco, CA

fetchthehorizon.com

Age: 31

Dec
10
awarded Yearling
Oct
30
awarded Great Question
Sep
30
awarded Explainer
Feb
24
awarded Great Answer
Jan
1
revised Regex grep file contents and invoke command
added 241 characters in body
Jan
1
comment Regex grep file contents and invoke command
What is $target that you're passing to your rm commands? Is it correct to assume you just want to run: rm dupe and rm somefile?
Jan
1
answered Regex grep file contents and invoke command
Oct
19
revised Exception handling in Linq queries
added 165 characters in body
Oct
19
answered Exception handling in Linq queries
Sep
7
comment Parallel ForEach confusion .Net C#
No problem. Next time you post a question try to use good formatting (proper indentation), and consistent casing (local variables should start with a lower cases letter) in the code section. Thanks.
Sep
7
answered Parallel ForEach confusion .Net C#
Sep
7
comment Parallel ForEach confusion .Net C#
Yup, if that property is declared outside the scope of your lambda then it will be shared between all of the threads. so when one of them assigns it, all of the others will be accessing the newly assigned value.
Sep
7
revised Parallel ForEach confusion .Net C#
deleted 1 characters in body
Sep
7
comment Parallel ForEach confusion .Net C#
Wait a minute... is StudentMessage.Statuses a static property!? If so then there is your problem. That static property will be shared between all your threads, so it's highly likely to get overwritten by one thread while being used by other threads. Sorry that took me a minute to spot but your casing and formatting was so horrible it was very confusing at first.
Sep
7
comment Parallel ForEach confusion .Net C#
Sorry, I hit [enter] before which apparently just posts the comment instead of entering a newline. However, I think the issue here, assuming your original code is less totally messed up, is not coming directly from threading/shared state issues (since I don't see any global state or shared variables here), but is instead coming from issues from your API or your "dbThread" calls. Is it possible that one of these is no thread safe, or could be the source of the inconsistency?
Sep
7
comment Parallel ForEach confusion .Net C#
Your code has some issues. I'm not sure if this was bad transcription or issues with your original code: You create "message" of type Student_Message and copy many properties from status (from student.Statuses), but then you add studentMessage to message, instead of the object you just created.
Sep
7
revised Parallel ForEach confusion .Net C#
Cleaned up code formatting.
Sep
5
answered Windows Service - read partial configuration file while service is running
Mar
14
awarded Favorite Question
Feb
8
comment Append text to Blob in Azure
The choice between page and block blobs is really more about optimizing for large chunks & sequential reading (block blobs) or small chunks and random access reading and writing (page blobs). You can indeed append blocks to a block blob, and re-commit the updated block list (you can also remove, insert, and replace).
1 2 3 4 5