473,224 Members | 1,607 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,224 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 1372
<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: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
2
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...

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.