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 88643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T22:35:31+00:00 2026-05-10T22:35:31+00:00

There is ConnectionManager which waits for incoming connections. For each incoming connection it creates

  • 0

There is ConnectionManager which waits for incoming connections. For each incoming connection it creates a Connection instance which handles the inbound and outbound traffic on this connection. Each Connection has a Watchdog which handles ‘bad connection’ conditions and calls registered ‘Listerners’. One ‘Listener’ is the ConnectionManager which closes the connection and deletes the Connection instance which in turn deletes the corresponding Watchdog.

Wait. A. Minute.

The Watchdog calls the ConnectionManager which deletes the Connection which deletes the Watchdog? The Watchdog chases its own tail.

I am completly blocked. How do I resolve this?


Solution: I will make the Listener thingy asynchronous, altough I don’t know yet how to do that without too much pain. The Watchdog doesn’t know about the ConnectionManager. It is fairly generic. Also the Win32-Thread-API doesn’t have something like ‘join’, so I might need to roll my own with GetExitCodeThread() and STILL_ACTIVE…

Thanks, guys.

  • 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. 2026-05-10T22:35:32+00:00Added an answer on May 10, 2026 at 10:35 pm

    If the watchdog is running in a different thread, then the problem isn’t too bad – the watchdog signals the ConnectionManager to delete with a asynchronous message, then exits it’s own thread.

    Mean-while, the ConnectionManager thread gets the delete message, and starts deleting the watchdog.

    To avoid race-conditions the watchdog destructor should join the watchdog thread, and cleanup the thread. (Probably also signal the watchdog thread, or assert() something about the watchdog thread being ready to exit).

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

Sidebar

Related Questions

In JBoss documentation there is possibility to declare <no-tx-datasource> which states: no-tx-datasource : This
I'm using oracle.ucp.jdbc.PoolDataSource for getting connections. Each connection wrapped to custom class (historic solution).
There is a column that exists in 2 tables. In table 1, this column
There's a Rails 3.2.3 web application which doesn't use any database. But in spite
There is a directed graph having a single designated node called root from which
There are two intents on the receiver side which are called from the same
There are nice SO question and answers about this issue, but these options didn't
SSIS 2005 I have a flat file connection which is the result of a
In my application, Spring manages connection pool for database access. Hibernate uses these connections
There have been multiple questions regarding this topic but I have never really settled

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.