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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:54:12+00:00 2026-06-12T09:54:12+00:00

The name kind of says it all. I’m writing this program in python 2.7,

  • 0

The name kind of says it all. I’m writing this program in python 2.7, and I’m trying to take advantage of threaded queues to make a whole bunch of web requests. Here’s the problem: I would like to have two different queues, one to handle the threaded requests, and a separate one to handle the responses. If I have a queue in my program that isn’t named “queue”, for example if I want the initial queue to be named “input_q”, then the program crashes and just refuses to work. This makes absolutely no sense to me. In the code below, all of the imported custom modules work just fine (at least, they did independently, passed all unit tests, and don’t see any reason they could be the source of the problem).

Also, via diagnostic statements, I have determined that it crashes just before it spawns the thread pool.

Thanks in advance.

EDIT: Crash may be the wrong term here. It actually just stops. Even after waiting half an hour to complete, when the original program ran in under thirty seconds, the program wouldn’t run. When I told it to print out toCheck, it would only make it part way through the list, stop in the middle of an entry, and do nothing.

EDIT2: Sorry for wasting everyones time, I forgot about this post. Someone had changed one of my custom modules (threadcheck). It looks like it was initializing the module, then running along its merry way with the rest of the program. Threadcheck was crashing after initialization, when the program was in the middle of computations, and that crash was taking the whole thing down with it.

code:

from binMod import binExtract
from grabZip import grabZip
import random
import Queue
import time
import threading
import urllib2
from threadCheck import threadUrl
import datetime

queue = Queue.Queue()
#output_q = Queue.Queue()
#input_q = Queue.Queue()
#output = queue

p=90
qb = 22130167533
url = grabZip(qb)
logFile = "log.txt"
metaC = url.grabMetacell()
toCheck = []
print metaC[0]['images']
print "beginning random selection"
for i in range(4):
    if (len(metaC[i]['images'])>0):
        print metaC[i]['images'][0]
        for j in range(len(metaC[i]['images'])):
            chance = random.randint(0, 100)
            if chance <= p:
                toCheck.append(metaC[i]['images'][j]['resolution 7 url'])

print "Spawning threads..."
for i in range(20):
    t = threadUrl(queue)
    t.setDaemon(True)
    t.start()
print "initializing queue..."
for i in range(len(toCheck)):
    queue.put(toCheck[i])

queue.join()    
#input_q.join()
output = open(logFile, 'a')
done = datetime.datetime.now()
results = "\n %s \t %s \t %s \t %s"%(done, qb, good, bad)
output.write(results)   
  • 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-06-12T09:54:14+00:00Added an answer on June 12, 2026 at 9:54 am

    What the names are is irrelevant to Python — Python doesn’t care, and the objects themselves (for the most part) don’t even know the names they have been assigned to. So the problem has to be somewhere else.

    As has been suggested in the comments, carefully check your renames of queue.

    Also, try it without daemon mode.

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

Sidebar

Related Questions

I want to make this kind of query: create procedure something @name varchar(13) as
Title kind of says it all. When I am running this in localhost everything
I perform this kind of query in my Python code to conn = rdbms.connect(instance=_INSTANCE_NAME,
The name says it all really. I suspect that insertion sort is best, since
Title kind of says it all. I have 2 tables Both with matching data
The question pretty much says it all. I'm trying to create a submission form
What is the name of that kind of structure? Or where can I read
How can you remove a wpf element by some kind of name? So sth
As far as I understand the branch-on-sign is the name of some kind of
I'm wondering is there some kind of JIT-hack going on with System.Lazy to make

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.