473,806 Members | 2,895 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HOWTO: properly call methods asynchronously? ??

I have a component I'm using in my application. When I call a method
myComponent.slo wMethod() my entire application hangs until slowMethod()
completes. I have tried using the .net threading model to trigger the
slowMethod inside a thread wrapper class but I still have the same behavior.
Is there anything I might be missing here?

Thanks for any help,
Alex
Jul 21 '05 #1
1 1223
CMM
Is it a control? Controls are not thread safe. Use BeginInvoke() to call
(actually queue) the method indirectly. If you're the author of the code in
the slowMethod, you can put Application.DoE vents() throughout the
slowMethod's code to ensure that it doesn't block the UI message pump....
there might be some consequences with using Application.DoE vents depending on
what you're doing in the code- but I've never had a problem.

"Alex Glass" wrote:
I have a component I'm using in my application. When I call a method
myComponent.slo wMethod() my entire application hangs until slowMethod()
completes. I have tried using the .net threading model to trigger the
slowMethod inside a thread wrapper class but I still have the same behavior.
Is there anything I might be missing here?

Thanks for any help,
Alex

Jul 21 '05 #2

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

Similar topics

2
2047
by: Julia | last post by:
Hi, I am using Asynchronously Delegates,and I wonder Can I call EndInvoke to end the processing before THE Asynchronously action ended? Thanks.
4
1323
by: ATS | last post by:
HOWTO: Add methods to C++ UserControl. Please help, I want to add a method to a C++ .NET UserControl that is based off the sample in the MSND article titled: How to automate Internet Explorer in a contained UserControl control by using Visual C++ .NET 2003
6
1676
by: Don Wash | last post by:
Hi All! I'm developing ASP.NET pages using VB.NET language. My background is VB6 and ASP3. Right now, I'm evaluating strategies on creating reusable and common functions and methods for ASP.NET. In ASP 3, it was nothing more than functions and methods coded in #Include Files. Now ASP.NET offers features such as Page Inheritance and full software development support. So I'm just wondering, what should I do if I have 5 functions, that...
4
2862
by: Ray Dukes | last post by:
What I am looking to do is map the implementation of interface properties and functions to an inherited method of the base class. Please see below. '**************************************************************************** ' Issues '****************************************************************************
1
206
by: Alex Glass | last post by:
I have a component I'm using in my application. When I call a method myComponent.slowMethod() my entire application hangs until slowMethod() completes. I have tried using the .net threading model to trigger the slowMethod inside a thread wrapper class but I still have the same behavior. Is there anything I might be missing here? Thanks for any help, Alex
5
4200
by: Stephen Barrett | last post by:
I have read many threads related to async fire and forget type calls, but none have addressed my particular problem. I have a webpage that instantiates a BL object and makes a method call. The BL object method actually sets up a delegate and calls a private method asynchronously and immediately returns back to the web page. The problem I am having is that the async call never happens. I added a quick logging call immediately as the...
3
1601
by: Sidanalism | last post by:
I miss the old way when asynchronous calls are driven my window messages. Yes a thread pool might greatly improve application performance but there are time I don't want my event to be fire in a thread differ from the calling thread. When a delegate is called in another thread it could be frustrating for I have to consider thread occurrence issues in all the codes it may invoke along my event chain. Sure the "Control.BeginInvoke()" could...
1
1930
by: kkao77 | last post by:
Someone help me please. I've tried to write an asynchronous method, but it didn't call my web service, do I need to do something in my webservice project to make it work? or if there is something wrong with the code that I have below. Thanks.. The following are my two methods where one is calling web service and
6
5131
by: HolyShea | last post by:
All, Not sure if this is possible or not - I've created a class which performs an asynchronous operation and provides notification when the operation is complete. I'd like the notification to be performed on the same thread thread that instantiated the class. One way to do this is to pass an ISynchronizeInvoke into the class and use it to synchronize the callback. In the constructor of the class, could I take note of the current thread...
0
9719
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
9597
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
10620
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10369
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...
0
10110
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...
0
9187
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
4329
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
2
3851
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3008
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.