473,320 Members | 1,612 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,320 software developers and data experts.

Threads Calling Threads?

I'm trying to think something through and am wondering if may have some
suggestions. I am building a Windows service (VStudio 2005, C#) that uses a
COM component to answer a telephone call(s). The aqpplication uses 6 trunk
channels for the lines. What I need to do is initialize all 6 lines and set
the event handler to witfor/answer the call. I have to pass the trun
kchannel to this thread as a parameter. Then, when the phone rings on that
trunk channel I need to start a new thread to do things like play prompts,
get digits, etc. This means that I'll have 6 threads created when the
service starts then dynamic threads to answer the call, etc. Any thoughts
would be greatly appreciated? Thanks a lot.
Dec 11 '06 #1
1 1378
<msnews.microsoft.comwrote in message
news:ut**************@TK2MSFTNGP04.phx.gbl...
I'm trying to think something through and am wondering if may have some
suggestions. I am building a Windows service (VStudio 2005, C#) that uses
a COM component to answer a telephone call(s). The aqpplication uses 6
trunk channels for the lines. What I need to do is initialize all 6 lines
and set the event handler to witfor/answer the call. I have to pass the
trun kchannel to this thread as a parameter. Then, when the phone rings
on that trunk channel I need to start a new thread to do things like play
prompts, get digits, etc. This means that I'll have 6 threads created
when the service starts then dynamic threads to answer the call, etc. Any
thoughts would be greatly appreciated? Thanks a lot.
Here's a thought: what is your actual question?

Your subject implies you want one thread to "call" another thread. But
that's not an entirely meaningful concept. In a very limited way, one
thread might "call" a thread that owns some UI element (like a window or
control) by using Invoke. But even there, what is really happening is that
data is copied to a place where the "called" thread can get at it safely,
when it runs, while the "calling" thread just waits for that operation to
complete.

There is no way for one thread to "call" another thread, in the sense that
one normally uses the verb "call" (that is, to pass execution control to a
new function by putting data on a stack, changing the instruction pointer,
and having the called function do its work and then return control to the
calling code).

There are ways to get data from one thread to another, but without knowing
what data you really want to pass and without knowing *when* you want to
pass it, it's hard to answer the question that you haven't really asked
anyway, even assuming that's the question you meant to ask. For what it's
worth, the most common means of passing data to a thread is to provide some
object that encapsulates the data when creating the thread in the first
place. The thread's entry point gets the reference to that object, from
which it can obtain the data being passed.

We don't necessarily even know what things like "trunk channels", "lines",
"play prompts", "get digits", etc. mean. It's doubtful that we need to
know, but if they are important to your question, you should define your
terms. If they are not important to your question, you should leave them
out entirely.

And of course, it should go without saying, that at some point if you want a
question answered, you should actually ask it.

Thanks,
Pete
Dec 11 '06 #2

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

Similar topics

5
by: Rob | last post by:
Hi there, Firstly, apologies for x-post but I'm hoping the post is relevant to both groups... I have written a native implementation in C, and a java wrapper class. This all works fine and...
6
by: RahimAsif | last post by:
Hi guys, I would like some advice on thread programming using C#. I am writing an application that communicates with a panel over ethernet, collects data and writes it to a file. The way the...
3
by: mjheitland | last post by:
Hi, I like to know how many threads are used by a Threading.Timer object. When I create a Threading.Timer object calling a short running method every 5 seconds I expected to have one additional...
10
by: cj | last post by:
I'm writing a TCP/IP server app that will have many simultaneous connections. The main thread listens for new connections and starts a thread to handle each requested connection. These are short...
11
by: vzaffiro | last post by:
Does the magic number of 25 only apply to the thread pool? Does it also apply to manually creating threads?
16
by: Thirsty Traveler | last post by:
I would like to create a test harness that simulates multiple concurrent users executing an individual thread. I would like this to be determined at runtime when the user specifies the number of...
9
by: koschwitz | last post by:
Hi, I hope you guys can help me make this simple application work. I'm trying to create a form displaying 3 circles, which independently change colors 3 times after a random time period has...
4
by: tdahsu | last post by:
All, I'd appreciate any help. I've got a list of files in a directory, and I'd like to iterate through that list and process each one. Rather than do that serially, I was thinking I should...
3
by: =?Utf-8?B?U0RlY291?= | last post by:
I have written a COM object that I am calling from a separate VB.net project. I am calling the DLL by using "Call myClass". I need to know when the DLL has finished processing before it returns to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.