Timeline for How to terminate python queue and instruct all consumer-threads to finish their tasks?
Current License: CC BY-SA 4.0
16 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Apr 27, 2023 at 12:51 | comment | added | g00dds | @user253751, I didn't think about that. Actually, I think this is a good approach, don't see any problems with that. Thank you for sharing your idea! | |
| Apr 27, 2023 at 12:47 | vote | accept | g00dds | ||
| Apr 27, 2023 at 8:05 | answer | added | Hans-Martin Mosner | timeline score: 0 | |
| Apr 27, 2023 at 1:23 | comment | added | candied_orange | @user253751 and how is that not a race condition? | |
| Apr 26, 2023 at 21:13 | comment | added | g00dds | Let us continue this discussion in chat. | |
| Apr 26, 2023 at 21:09 | comment | added | g00dds | @candied_orange, consumers can't just die when they try to get an item from the queue while it's empty because it takes time to produce an item by the producer (the task is computationally expensive), so it's not guaranteed that the queue is always non-empty while it's not terminated | |
| Apr 26, 2023 at 21:04 | comment | added | candied_orange | The heart of the Producer Consumer pattern is the blocking queue. But it's used to block the producers when it's full. Not the consumers. Couldn't the consumes just die when they hit a dry hole? | |
| Apr 26, 2023 at 20:54 | comment | added | g00dds | @candied_orange, the pattern is what I'm trying to implement, but as I read it defines a way to communicate and synchronize many threads, but it doesn't define a way to terminate that communication, and that is what I don't know how to implement better in my situation, so I still don't understand what solution you propose | |
| Apr 26, 2023 at 20:36 | comment | added | candied_orange | Does it meet all your needs or is another requirement still outstanding? | |
| Apr 26, 2023 at 20:36 | answer | added | JimmyJames | timeline score: 1 | |
| Apr 26, 2023 at 20:34 | comment | added | g00dds | @candied_orange, I hadn't. Now I read about it, and that's what I'm trying to implement. And yet, I couldn't find the answer to my question. | |
| Apr 26, 2023 at 20:18 | review | Close votes | |||
| May 11, 2023 at 3:07 | |||||
| Apr 26, 2023 at 20:06 | comment | added | candied_orange | Have you heard of the Producer Consumer Pattern? | |
| Apr 26, 2023 at 20:03 | history | edited | g00dds | CC BY-SA 4.0 | added 38 characters in body |
| S Apr 26, 2023 at 19:57 | review | First questions | |||
| Apr 27, 2023 at 6:53 | |||||
| S Apr 26, 2023 at 19:57 | history | asked | g00dds | CC BY-SA 4.0 |