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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:23:43+00:00 2026-05-23T09:23:43+00:00

I am creating my own priority queue of sorts. It is not a typical

  • 0

I am creating my own priority queue of sorts. It is not a typical priority queue in that items are inserted with a given priority. Rather items can be added to the queue and they begin at the highest priority(let say we have 5 queues, queue 1=highest priority, queue5=lowest)), so the item is added to queue 1 initially.

The user of this data structure can get the next() element, which returns an element based on some factors that I am interested in, namely the priority, but it is not dequeued from the entire data structure. The user provides some feedback to the validity of the item returned from the previous call to next()(eg. a pass/fail result), and based on that, the item is moved up or down in priority. Basically, elements that fail get used less often and I have mechanisms to eventually remove elements that fail too often.

1)Any suggestions to improve the interface? I do not like having to retrieve an element from the next() call and then provide feedback with another function call. There is too much room for error where the state gets messed up. (ie user does not report result before getting next element..etc…). Also, it would be desireable to allow this to be thread safe.

2)I am using a private nested class that wraps the elements I am interested in along with some attributes associated with each element to track statistics on the element(eg pass/fail counts etc…), and would like to know if there was a way to access the outer class members from the inner class?

  • 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-05-23T09:23:44+00:00Added an answer on May 23, 2026 at 9:23 am

    Not sure I understand the question exactly, but what is wrong with the next() not waiting for the returned feedback? Users of the structure pull the next() element out of the queue and then submitFeedback() on the element when they are ready. Meanwhile, other users can pull out the next() elements as well, asynchronously. The queue handles calls as they come in. If this doesn’t help, could you explain the problem with handling state in more detail?

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

Sidebar

Related Questions

When creating my own macro, and trying to add it so that anyone can
I'm creating my own user control that can display n amount of images. Here
I'm creating my own JavaScript Array-like object and I have methods that call closures.
I'm creating my own Group model; I'm not referring to the builtin Group model.
I am creating my own custom T4 Template that integrates with an ADO.NET Entity
I'm creating my own RSS Reader, and to see which RSS items were already
I'm creating my own skin for subtext, and there's one thing I can't figure
I'm creating my own template engine using PHP. The basic idea is that for
I am creating my own file tagging system for an application and have not
I have a challenge similar to creating-my-own-plug-ins-for-my-own-project-in-c# and late-loading-a-net-plugin-dll , with the added headache

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.