Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8688953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:30:45+00:00 2026-06-12T23:30:45+00:00

I use ORBacus . I have a multithreading application and I want to have

  • 0

I use ORBacus. I have a multithreading application and I want to have several ORB objects in the same process. The idea is: each thread to have its own ORB and to be connected to different server.

Is this even possible? If so – how?


“What have you tried?” : I have

CORBA::ORB_var m_varOrb;

in each thread. Each thread calls. Each thread has Reconnect method, which executes:

// ...
m_varOrb = CORBA::ORB_init( argc, argv );

The issues, I have:

  • when several threads are trying to reconnect at the same time, the application crashes in m_varOrb->destroy(); or in CORBA::ORB_init.

  • I tried to sync the threads, so that all threads try to reconnect to the configured server one by one (using a static mutex) – still not working – when one thread tries to destroy “its” ORB object – crash again in destroy (some assert fails, because some reference count is > 1; looks like a reference counting pointer to the real ORB object)

  • I added a conditional wait, so the threads start calling ORB_init only when all threads has executed destroy; made a singleton wrapper class around the ORB, sync-ed the threads to connect one after the other and everything started working perfectly fine. BUT this means – only one ORB, so only one server. Bad.

So, all of these things made me thing, that I’m allowed to have only one ORB object per process. Am I missing something?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T23:30:48+00:00Added an answer on June 12, 2026 at 11:30 pm

    By default, CORBA ORBs should behave like singletons if you pass the same “ORB id” parameter when initiatlizing them with ORB_init(). However, you’re probably passing the same parameter each time, which means that the ORB assumes you want all those threads to share the same underlying ORB instance.

    So the first thing you need to do is to find in ORBacus’s documentation how to pass unique ORB IDs within each thread. Perhaps use the thread ID as the discriminant.

    That said, your approach could use improvement. Creating an ORB in each thread is a very expensive operation. Instead, create one shared ORB on application start and then allow each thread access to it. It should be already protected by ORBacus against concurrent access. Make sure you only do ORB shutdown/destroy in the mainline too, not in the threads.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question is related to: Is it possible to have several ORB objects in
Use case: we have some project meta-data files which we want tracked, but are
use PHP and MySQL. Want my website to have the feature of image uploading
use case is simple: I want to run some boiler plate code before each
use C#,want to upload excel file on google doc. bellow syntax use to upload
Use Case: End-User searches for something and an ArrayCollection is returned with Result objects.
Use Elixir and have two entities -- Voter and Candidate -- with many to
use javascript or other method ? have any recommendation?
Use case: You have 2-3 files displayed in your MacVim window(s). You press ctrl+Q
Use case is to have a server connect to thousands of users email accounts

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.