In the concurrency runtime introduced in VS2010, there is a concurrent_queue class. It has a non blocking try_pop() function.
Similar in Intel Thread Building Blocks (TBB), the blocking pop() call was removed when going from version 2.1 to 2.2.
I wonder what the problem is with a blocking call. Why was it removed from TBB? And why is th...
generate all possible subsets of a given Set that contain n elements using stack and queue without using recursion.
and then find the complexity of this pseudo code
so if we have a set {1,2,3)
then the subsets are 2^n so its 2^3 and its 8 subsets
result will be
{}
{1}
{2]
{3}
{1,2}
{1,3}
{2,3}
{1,2,3}
...
I always mix up whether I use a stack or a queue for DFS or BFS. Can someone please provide some intuition about how to remember which algorithm uses which data structure?
Thanks!!
...
Hi guys
I have LinkedList Queue, And im trying to read a file with numbers of people in queue waiting to be helped and the number of agents available to help at the time. I do not know to check if they are busy or how to add the people waiting in the queue in the first place. Can anyone Help me? This is the code I have so far.
public ...
Hi all,
I'm developing a solution to retrieve poison messages from a backout queue in Websphere 6.1.
My question is: when this msg (ie. TextMessage) is re-queue from a regular queue to backout queue, what is the queue name in msg.getJMSDestination() and msg.getJMSReplyTo()?
For example:
I've got a msg with destination to myQueue. Howe...
what is the difference among list, queue and set?
...
I am using the same UDP socket for sending and receiving data. I am wondering if packet queuing for DGRAM sockets is already present, or do we have to handle it separately.
If the user code has to handle queueing, how is it done? Do we have separate threads to recvfrom for the socket and put the packet in the reciver_queue and to sen...
I wanted to do some testing with queues and using Queue.Synchronized to see how it worked out when having two threads putting stuff into a queue, and a third thread reading it out. It seemed fairly simple, but it's not working right and I'm not sure why. Probably a silly mistake on my part. There's a bit more to it though.
class Program...
I have a C program that records video and audio from a v4l2 source into flv format. I noticed that the program did not work on newer versions of ubuntu. I decided to try to run the problamatic pipeline in gst-launch and try to find the simplest pipeline that would reproduce the problem. Just focusing on the video side I have reduced it t...
I'm using the following approach to handle a FIFO queue based on Google App Engine db.Model (see this question).
from google.appengine.ext import db
from google.appengine.ext import webapp
from google.appengine.ext.webapp import run_wsgi_app
class QueueItem(db.Model):
created = db.DateTimeProperty(required=True, auto_now_add=True)
...
----What I'm doing----
So I have an assignment that takes an input of characters then calculates the capital gain for the string using a queue.
I'm stripping the input data then putting it into an arraylist that I then queue. I'm suppose to then dequeue the data to calculate the the capital gain.
----The problem----
The problem I'm ha...
Hi Guys,
I have an ASP.NET MVC 2 Web Application (.NET 4, C#), where user's can search for locations.
The page is implemented with an auto-complete box, similar to many websites. (Google, YouTube, etc)
Now, the AJAX call to the server results in a Stored Procedure call to the database. (whilst efficient, could result in a lot of round...
I am looking for a case study of companies that use Cloud message queueing.
What are the benefits of such a service over rabbitmq (if any)
I know there are several mature services like SQS of amazon, OnlineMQ and Linxter.
...
I keep getting the first entry appended 4 times instead of one time.. when I append my first entry to the Queue it appends it 4 times..I thought this might be the problem..but it looks like it isn't. I can't find where the problem is..
I also created a print function for the nodes, and it showes that there are 4 of the same entries in t...
Hi,
I am completely new to java, but I have urgent requirement to create a queue and thread. I am confused which queue class must be used.
Here's the scenario:
I need to a thread to handle user events from the application layer as well as callback events from the lower middleware layer.
For this purpose, it was decided that a queue w...
I'm trying to write a durable WCF service, whereby clients can handle that the server is unavailable (due to internet connection, etc) gracefully.
All evidence points to using the MSMQ binding, but I can't do that because my "server" is the Azure cloud, which does not support MSMQ.
Does anyone have a recommended alternative for accompl...
how mod is used to determine the front and end of the circular array in a queue?
...
I have a question that I cant seem to find an answer on.
This is my first time using RabbitMQ in a "big" application and am wondering how the queues work in a cluster.
I understand that the routing information (queues, exchanges, bindings) is on all nodes in the cluster, but the queue its self resides on the machine that it was created o...
Today i got a idea to make an ThreadQueue for C++, for my Server Application.
unsigned int m_Actives; // Count of active threads
unsigned int m_Maximum;
std::map<HANDLE, unsigned int> m_Queue;
std::map<HANDLE, unsigned int>::iterator m_QueueIt;
In an extra Thread i would to handle these while:
while(true)
{
if(m_Actives != m...
Hello,
I've tried to get an mp3 file played with Audio Toolbox and Audio Queues, but whatever I try, I don't get anything played (neither in the simulator nor on the device). When I run it in the simulator it tells me:
"Prime failed (-66674); will stop (0/0 frames)",
so I think there is a basic mistake somewhere, maybe in the AudioEn...