471,066 Members | 1,588 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,066 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 1294
<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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Rob | last post: by
6 posts views Thread by RahimAsif | last post: by
10 posts views Thread by cj | last post: by
11 posts views Thread by vzaffiro | last post: by
16 posts views Thread by Thirsty Traveler | last post: by
3 posts views Thread by =?Utf-8?B?U0RlY291?= | last post: by

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.