473,765 Members | 2,057 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

.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 1537
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*@discussion s.microsoft.com > wrote in message
news:3D******** *************** ***********@mic rosoft.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*@discussion s.microsoft.com > wrote in message
news:3D******** *************** ***********@mic rosoft.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
1613
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 needed. My concerns are these: I want it to be thread-safe for any number of simultaneous sessions. I want it to be efficient-- is making one object available to potentially hundreds of simultaneous sessions an inefficient approach?
3
2817
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 of the child thread? Or do I need to create a new thread object and join it to my current thread in order to guarantee execution of code in a child process? -Ron
1
4475
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 assuming that this is not an uncommon piece of software. I want to get an architecture that conforms as closely as possible with the recommendations from Microsoft on developing Windows Services, but to be honest I have found difficultly in...
4
1785
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 entry and gathering, returning the results to the ASP.NET caller. I have tried an AsyncPage class (implements IHttpAsyncHandler and uses custom thread pool class from DevelopMentor.ThreadPool -http://staff.develop.com/woodring); I have tried the...
7
1132
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 click events on the mainform remain in real time. Through a little experimentation it seems that I can only use 1 sub to update the form to avoid cross threading. So maybe have the timer fire the 3 requests and then when they are complete fire the...
15
2075
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 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...
7
3175
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 proportion to another language and architecture. For this purpose, I am investigating technologies that best fit the requirements. The current plan for the architecture of the ported software includes:
126
6736
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: http://www.cse.wustl.edu/~schmidt/ACE.html the same way that the STL (and subsequently BOOST) have been subsumed? Since it already runs on zillions of platforms, they have obviously worked most of the kinks out of the generalized threading and processes idea (along with many...
35
2076
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 as OS. I have some hardware devices that have to send data to and receive data from a server on the network. I will use one TCP stream for all the communication. Basically what I plan to do is the following: - for the program to be as modular...
0
9568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9404
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10007
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9959
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9835
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7379
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3926
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.