473,396 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

.NET poor threading architecture?

WXS
When I see things in .NET 2.0 like obsoletion of suspend/resume because of
the public reason MS gives of they think people are using them
inappropriately.. use mutex, monitor and other synchronization objects
instead and oh by the way you shouldn't be using them as they can cause
deadlock and other major problems, screams bug or threading architecture
issue and lack of willingness or priority to correct. In reality those API's
are for controlling starting and stopping of threads like umm for example an
Operating system does (surely MS knows something about that :) ) (I think
they should leave these and fix this.)

Of course there is the other issue that since threads are interruptible due
to the gc they must re-acquire locks afterwards and thus could be re-ordered
and then threading becomes non-fair.

Given these and other issues I think MS should reconsider making WinFX the
primary OS API, it's starting to scare me about what else is under the covers
we haven't found yet.
Jun 14 '06 #1
2 1514
At some point every developer has to take responsibility for what he/she
does, what he/she uses, his/her understanding of what he/she does and/or
uses, and the consequences of his/her decisions with regards to what he/she
develops.

The more powerful a technology is, the more dangerous it is, in that it has
a greater capacity to cause damage if misused. Atomic power comes to mind.
Pointers come to mind.

The more complex a technology is, the more permutations there exist of
complexity in that which employs the technology. The more complex the
result, the greater the possibility that there will be problems with it.
Threading comes to mind.

Now, Microsoft could try to protect us all by attempting to hide complexity
and subvert power in the tools they create. In fact, they do, to a certain
extent. Much of the Windows API is still missing in the .Net Framework. Real
pointers are extremely difficult to get at. Low-level threading is
discouraged. But guess what would happen if they went too far with this
idea? Their business would go to the competition that provides the power and
complexity we all crave.

So, getting back to my first point...

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

A lifetime is made up of
Lots of short moments.

"WXS" <WX*@discussions.microsoft.com> wrote in message
news:3D**********************************@microsof t.com...
When I see things in .NET 2.0 like obsoletion of suspend/resume because of
the public reason MS gives of they think people are using them
inappropriately.. use mutex, monitor and other synchronization objects
instead and oh by the way you shouldn't be using them as they can cause
deadlock and other major problems, screams bug or threading architecture
issue and lack of willingness or priority to correct. In reality those
API's
are for controlling starting and stopping of threads like umm for example
an
Operating system does (surely MS knows something about that :) ) (I think
they should leave these and fix this.)

Of course there is the other issue that since threads are interruptible
due
to the gc they must re-acquire locks afterwards and thus could be
re-ordered
and then threading becomes non-fair.

Given these and other issues I think MS should reconsider making WinFX the
primary OS API, it's starting to scare me about what else is under the
covers
we haven't found yet.

Jun 14 '06 #2
WXS
Basically microsoft for the suspend/resume api's has to at least fix it so
that suspend happens at a safe point from the .net perspective, everything
else leave up to the developer and let them do what they need to do.

The probablem apparently is with the suspend api you can cause .net deadlock
as it allows suspends while it may be holding security locks or even type
constructor instantiation locks that could deadlock other code. If they
could stop at a safe point then the API's would still be plenty useful, but
not for the reasons they suggest.

Win32 API can suspend a resume a thread fine.. why? because it makes sure
the thread isn't holding from an OS perspective any kernel level locks that
could freeze the OS prior to suspending it. Could they do this for .NET...
probably unless there is a significant architecture issue with their
threading model I would guess. Is it easy (No... but worth it to make .net a
serious development platform.).

"Kevin Spencer" wrote:
At some point every developer has to take responsibility for what he/she
does, what he/she uses, his/her understanding of what he/she does and/or
uses, and the consequences of his/her decisions with regards to what he/she
develops.

The more powerful a technology is, the more dangerous it is, in that it has
a greater capacity to cause damage if misused. Atomic power comes to mind.
Pointers come to mind.

The more complex a technology is, the more permutations there exist of
complexity in that which employs the technology. The more complex the
result, the greater the possibility that there will be problems with it.
Threading comes to mind.

Now, Microsoft could try to protect us all by attempting to hide complexity
and subvert power in the tools they create. In fact, they do, to a certain
extent. Much of the Windows API is still missing in the .Net Framework. Real
pointers are extremely difficult to get at. Low-level threading is
discouraged. But guess what would happen if they went too far with this
idea? Their business would go to the competition that provides the power and
complexity we all crave.

So, getting back to my first point...

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist

A lifetime is made up of
Lots of short moments.

"WXS" <WX*@discussions.microsoft.com> wrote in message
news:3D**********************************@microsof t.com...
When I see things in .NET 2.0 like obsoletion of suspend/resume because of
the public reason MS gives of they think people are using them
inappropriately.. use mutex, monitor and other synchronization objects
instead and oh by the way you shouldn't be using them as they can cause
deadlock and other major problems, screams bug or threading architecture
issue and lack of willingness or priority to correct. In reality those
API's
are for controlling starting and stopping of threads like umm for example
an
Operating system does (surely MS knows something about that :) ) (I think
they should leave these and fix this.)

Of course there is the other issue that since threads are interruptible
due
to the gc they must re-acquire locks afterwards and thus could be
re-ordered
and then threading becomes non-fair.

Given these and other issues I think MS should reconsider making WinFX the
primary OS API, it's starting to scare me about what else is under the
covers
we haven't found yet.


Jun 14 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jon Sequeira | last post by:
I'm have a class that represents shipping cost data for a commerce web site. The underlying data may only change once a month, maybe less, so I'd rather not hit the database every time the class is...
3
by: ron | last post by:
If I use the System.Threading.ThreadPool.QueueUserWorkItem to spawn a new threaded process, will this process be executed regardless of whether or not the current process ends prior to completion...
1
by: benmorganpowell | last post by:
I have a small windows service which connects to a POP3 server at defined intervals, scans the available messages, extracts the required information and inserts the data into a SQL database. I am...
4
by: Bill Thorne | last post by:
We have a COM object that has been wrappered for use in .NET and which can make calls which can take a while to execute. These are mainframe integration calls that might perform a lot of data...
7
by: melton9 | last post by:
I have a web service that I believe needs to implement threading. I have a timer setup to fire 3 requests and have them do some calculations and send the info to the mainform. I also need the...
15
by: WXS | last post by:
When I see things in .NET 2.0 like obsoletion of suspend/resume because of the public reason MS gives of they think people are using them inappropriately.. use mutex, monitor and other...
7
by: Samuel | last post by:
Hi, I am looking for some recommendations for client/server technologies and for the communication involved. I am currently planning to port a Perl application that has grown out of...
126
by: Dann Corbit | last post by:
Rather than create a new way of doing things: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2497.html why not just pick up ACE into the existing standard:...
35
by: Alessio Sangalli | last post by:
Hi all. I am writing the documentation for the program I'm going to develop (yes, documentation before the implementation, it's awesome!). In short, it will run on an embedded platform wint Linux...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.