473,786 Members | 2,567 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Post Not Showing REPOST - Multi-Threading Conundrum...

For some odd reason my original post was double posted then removed
from the forums. Odd happenings but wanted to re-post incase no one
saw the original, thanks :D
Salutations!

New to the forums but have gotten many an idea from lurking over the past few months but alas it's time to begin positing; posting to a
problem I cannot seem to resolve. This is a long description but my
hopes are the more information the better someone may be able to help
:)
The Problem:
---------------------------------------------------------------------- I have an application that, based on configuration, spins a new class object into a thread. These threads enable communications to
specific hardware running on a manufacturing floor.
Each object, in and of itself, establishes communications to said hardware and begins actively monitoring for events, data and
changes.
Upon starting the object, inside a new thread spawned by the parent thread, I begin my communications and once done perform a .WaitAll()
call on the `Thread.Current Thread`. This leaves the thread in a
waitstate allowing the the thread and the object contained within
persistance as it waits for it's work to be triggered.
Todate, I have been able to successfully spin these objects and persist the threads while waiting and event triggers raised within
the threaded objects work fine however add another twist; MSMQ.
Once the parent service, main thread, spins an instance of an object class in a new thread occationally the parent receives messages via
MSMQ wherein the parent needs to instruct the child objects (on
threads) to perform a task. Calls into these objects/threads are
proving harder than I had initially anticipated and since I cannot
seem to get the call to invoke on the target threaded objects context
I become deadlocked in my communications process.
Quite simply the application logic is:

Startup:
--------------
Service starts, creates new Parent Object
Parent Object creates new Child Object and adds to internal collection Parent Object creates new thread for each Child Object and issues .Start Child Object spins up in own thread establishing communications
Child Object, utilizing CallBack, notifies Parent of Success and .WaitOne Parent Object repeats process until all Child Objects created

Runtime:
--------------
Child Object manages it's own thread, processes and methods
Parent Object receives MSMQ Message for Child Object
Parent Object calls method inside Child Object to perform task
The Attempts:
---------------------------------------------------------------------- I have tried various methods to wake the Child thread and issue the work via events, callbacks and asynch invokes without success. The
Child Object is on a STA Thread and upon the Parent Object getting
the MSMQ Event for a message arrival and the subsequent call to the
Child, it seems .NET is spinning off a *new* MTA thread with the call
to the Child Object's method thus deadlocking my communications since
the Child is already using the same resources.
I'm tried to implement the ISerializableIn voke, ContextBoundObj ect and other `Serializing` avenues in .NET but each and everytime I
cannot seem to communicate to the Child thread to wake it and perform
the task given.

Whew, said this would be long eh? :D

If anyone could shed light in how to gain the context of the threaded Child Object to issues method calls on the thread the Child
Object resides would be must helpful!
Additional information can be provided but since encapsulates the `general idea` of the problem I'll finish up.
Thanks in advance

Richard Berg


Nov 21 '05 #1
0 906

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

Similar topics

7
2602
by: NotGiven | last post by:
Some have said to used GET for all quesries except those that manipulate/change a database. Some say use POST to quasi-hide parameters. Your thoughts?
0
2314
by: Dotnetified | last post by:
Reposting after about 2 weeks of no response ... thanks if you can help... ---------------------------------------------------------------------------- -------------- To anyone who thinks they know it all: ;) We recently upgraded our MSDN Version of VS.NET 2002 to VS.NET 2003... Things are all working well, except we've run across a new bug or issue since our adopting of the new package.
16
2074
by: Shelly | last post by:
(posted previously on comp.lang.php but no response received. Cross-posted in the dreamweaver forum) I am confused about what goes on with method POST. Here is an overview of a my code, sketching it out: <?php if (isset($_POST) && $_POST=="Submit") { ---Do a bunch of stuff--- if (isset($_SESSION)) unset($_SESSION);
1
2147
by: frey | last post by:
the code is used for repost $HTTP_POST_VARS from a form to the insert page at the "preview" page <?php /* Re-Post all POST'ed variables */ reset($HTTP_POST_VARS); while (list($key, $value) = each($HTTP_POST_VARS)) { if (!is_array($HTTP_POST_VARS)) { echo tep_draw_hidden_field($key, htmlspecialchars(stripslashes($value)));
1
1362
by: James Fortune | last post by:
In the code segment for the IsHoliday function I used Mid(strFlag, 1) instead of Mid(strFlag, 1, 1) The ,1 needs to be added whereever the Mid function is used in that function in order to isolate the single digit in strFlag. If not, the
2
1592
by: Rene \(Programmer Wannabe\) | last post by:
Sorry for reposting this question, I asked this a couple of days ago but got no definite answer as to why the Array class behaves this way. Hope this time I will have better luck. Please read below: Why do I have to resort to using the static method of the array like this: int someArray = new int; Array.Sort(someArray);
14
2839
by: Steve McLellan | last post by:
Hi, Sorry to repost, but this is becoming aggravating, and causing me a lot of wasted time. I've got a reasonably large mixed C++ project, and after a number of builds (but not a constant number) linking (and sometimes compiling) becomes immensely slow, and task manager shows that link.exe (or cl.exe) is barely using any processor time, but an awful lot of RAM (around 150-200MB). I'm going to keep an eye on page faults since I can't...
1
4133
by: Jeremy | last post by:
I apologize for the repost but I am frustrated and desperate for a solution. I need to detect if an external application is displaying a modal form. I.E. dialog box or error message. I found a number of promising examples but unfortunetly they are VB6 examples and just don't seem to be working correctly: ---------------Start Code------------------------------------
10
2296
by: Anthony England | last post by:
(sorry for the likely repost, but it is still not showing on my news server and after that much typing, I don't want to lose it) I am considering general error handling routines and have written a sample function to look up an ID in a table. The function returns True if it can find the ID and create a recordset based on that ID, otherwise it returns false. **I am not looking for comments on the usefulness of this function - it is
4
3034
by: thehuby | last post by:
Is there any way of disabling the repost of information when a user hits the back button? Is the only way to do this to actually use some sort of redirect on the page receiving the initial post (though this won't stop them hitting back twice and possibly reposting will it?) Thanks, Rick
0
9650
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
9497
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
10363
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...
1
10110
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
9962
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
6748
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();...
0
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.