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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T09:58:10+00:00 2026-05-18T09:58:10+00:00

I’m trying to get the following global variable storage_i to be accessible to the

  • 0

I’m trying to get the following global variable storage_i to be accessible to the lvl1 function, I have been able to pass it to other functions inside of the class birdofprey but I can’t get it outside of that framework. I have looked around at using global variables between functions, etc, and I have also seen global var usage discouraged. But, basically I am trying to have the value of storage_i summed up from all the threads. So if that could be done without a global variable that would also be great. Any help would be appreciated.

The Code: https://github.com/eWizardII/homobabel/blob/master/Experimental/demo_async_falcon.py

  • 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-05-18T09:58:11+00:00Added an answer on May 18, 2026 at 9:58 am

    Replace this:

    global storage_i
    storage_i = i 
    

    With this:

    birdofprey.storage_i = i
    

    You also have a typo at line 75:

    storage_ii = stroage_i + storage_ii
    

    (stroage_i was intended to be storage_i)

    This line should actually be:

    storage_ii =  birdofprey.storage_i + storage_ii
    

    EDIT: Also, without having looked closely at it, your use of a class attribute (storage_i) looks like it’s susceptible to race conditions. Consider using mutexes to guard accesses to that attribute. I think you also need to wait for the threads to finish executing before you can access the values.

    But I’m not sure if a global (or class attribute) is really what you want. I think what you really want is a thread-local variable that you can access after the thread has finished (see the Thread.join method.) If I’m reading that correctly, then forget what I wrote above about mutexes. Instead, set the storage_i attribute as self.storage_i (creating a separate instance for each thread.) Then in the for loop where you’re summing the values, access the value as urlv.storage_i. Again, it looks like it’s important that you perform a join on each thread before you try to access its values.

    That’s all the help I can offer for now; perhaps tomorrow morning (my time) I can check in again.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am trying to loop through a bunch of documents I have to put
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
this is what i have right now Drawing an RSS feed into the php,
I am trying to render a haml file in a javascript response like so:
I have this code to decode numeric html entities to the UTF8 equivalent character.

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.