Python Forum
Queuing the file content and run the thread.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Queuing the file content and run the thread.
#8
Apologies for taking so long to get back, but I've been able to reproduce the issue very concisely
import Queue
q = Queue.LifoQueue()
q.put(None)
q.join()
This will hang. Here is the same thing with more prints
import Queue
q = Queue.LifoQueue()
print "Putting into the queue"
q.put(None)
print "About to join()"
q.join()
print "Done with join()"
Basically, the problem is q.join() will block until all the items in the queue have been completed. More specifically, the docs say that task_done() being called is required to resolve items, but when you join on the queue you haven't started any threads yet.

I haven't dug deeper into your code, but I'll let you integrate this for now. If you have followup questions I'm still happy to come back to this, though as you know that could take some time....
Reply


Messages In This Thread
RE: Queuing the file content and run the thread. - by micseydel - Feb-06-2017, 12:49 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Queuing Theory in Python NOLA_Saints 0 844 Feb-22-2023, 11:42 PM
Last Post: NOLA_Saints
  Extracting Specific Lines from text file based on content. jokerfmj 8 3,252 Mar-28-2022, 03:38 PM
Last Post: snippsat
Thumbs Up Parsing a YAML file without changing the string content..?, Flask - solved. SpongeB0B 2 2,380 Aug-05-2021, 08:02 AM
Last Post: SpongeB0B
  Opening file and outputting its text content example leodavinci1990 1 1,953 Oct-12-2020, 05:33 AM
Last Post: buran
  how to view file content of .docx while in Recycling bin NeoPy1 0 1,469 Sep-16-2020, 10:11 PM
Last Post: NeoPy1
  copy content of text file with three delimiter into excel sheet vinaykumar 0 2,440 Jul-12-2020, 01:27 PM
Last Post: vinaykumar
  Read content of GitHub file sridhar 5 10,289 Apr-29-2020, 11:49 PM
Last Post: sridhar
  Error SQLite objects created in a thread can only be used in that same thread. binhduonggttn 3 15,889 Jan-31-2020, 11:08 AM
Last Post: DeaD_EyE
  How do I read the HTML files in a directory and write the content into a CSV file? glittergirl 1 2,677 Sep-23-2019, 11:01 AM
Last Post: Larz60+
  save content of table into file atlass218 10 10,272 Aug-28-2019, 12:12 PM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020