a-synchone construction of an object

A

Anthony

Hi,
Can anyone help me out here,

I'm looking for a design (pattern?) for a-synchronic construction of a
class.
I need this design in a framework which will run in a multithreaded system.
I want a class (client) in threadA to a-synchronously construct a class
(server) in threadB.
Both threads will probably need a kind of construction manager object.
For passing the request I will probably need to use a parameterised class.
The client class running in threadA sends a request, and the construction
manager running in threadB, will handle the request.

Does this problem sounds familiar to anyone? Is there a standard solution to
this problem?

Thanks in advance,
Anthony Lansbergen
Adesys b.v.
 
V

Victor Bazarov

Anthony said:
I'm looking for a design (pattern?) for a-synchronic construction of a
class.

Look at "factory method".
I need this design in a framework which will run in a multithreaded system.
I want a class (client) in threadA to a-synchronously construct a class
(server) in threadB.

Doesn't sound right. You want the threadB to construct an object to
be used in the threadA, upon a request from threadA. Nothing asynch
in that, AFAICS.
Both threads will probably need a kind of construction manager object.

More like a request manager.
For passing the request I will probably need to use a parameterised class.

You just need a custom request.
The client class running in threadA sends a request, and the construction
manager running in threadB, will handle the request.
Yep.

Does this problem sounds familiar to anyone? Is there a standard solution to
this problem?

No. There are no threads in the standard. But you're on the right
track. ThreadA sends a request, threadB handles it. Once the object
has been created, threadB notifies threadA about the location of it.
After than threadA can use the object.

Not a C++ language problem, by the way.

Victor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top