Skip to content

Add Secondary Worker Node for PriorityQueue #9

@DragonflyRobotics

Description

@DragonflyRobotics

Problem and Description
For the General Intelligence, the microphone transcription should always be running. But, if that is always in the queue, the other tasks like unsupervised detection and data download won't occur. The primary and daemon thread will be occupied. Is it possible to add a second worker node and a manager to handle task distribution and processing?

Solution
If we add a second __worker function to the PriorityQueue class as well as a manager to automatically distribute tasks once they are published, we can have more processes running with faster and more efficient execution. This also resolves the issue described above.

Alternatives
Multi-threading and Multi-processing managers were considered. In this idea, there would be a multiprocessing pool that would take tasks and assign them to a core manager. Each core manager takes the tasks and assigns them to a thread. This way, we get complete resource utilization. However, Python's GIL(Global Interpreter Lock) makes it arduous to implement. There is a separate issue for this: #10 .

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions