Unfortunately,

I had to delete all the comments, and no new comments are coming in for some reason, I cannot figure out why! What could be the reason why there are 2,000 comments in 2 weeks and there’s not a single one any more?

Ah ha! when I logout and look at the website, it says “You must be logged in to comment” so that is why!

And to think, where would we be if the Russians didn’t do all that fighting?? We wouldn’t be here, after running this program I ran it poked me in the stomach down by where the package from the mail, I ordered amphetamine, not methamphetamine but amphetamine off the dark web, I used to buy it from the silk road in 2014. One time in 2015 december I bought some and my stomach, a hole in my stomach I just caught on fire kinda and there was still to this day this patch of dead skin around where it was hurting, right where my belt would be touching my body, there is a circular patch of dead skin, and it didn’t go away like it only just went away a few years ago and it started in 2015. They said it wouldn’t be anything, like it would be no problem…

With that on the table, and we have the Russians dying at 2k per week, where would we be without that fight taking place? We still cannot afford this stuff that I do because it just poked me back in the stomach again, it felt like I pulled a muscle in my stomach, just 2 days ago or yesterday I think, and so that tells me that we cannot afford it because right after I got poked I got really heavy, like somebody had put a weight not on me but on my soul, so I could feel this heavy weight like I was going to fall through the ground, and then it just went away after about 20 minutes, the fear that your going to fall is like so great that I almost can’t deal with the fear from it.

But I dealt with it, and here we are, and we have a Python multi-threaded application coming up, basics of multi-threading with python.

Python
# to use the "Process" of "multithreading" we need to import this
import multithreading

# to use the "sleep" object of "time" we must import time
import time

# the actual function our threads will run
def add_and_display():
  
  # declare a number
  x = 0
  
  # seconds to sleep
  seconds_to_sleep = 2
  
  # always do something, here we do 3 things. Increment x, sleep for 2 seconds
  # and display the value of x
  while True:
    
    # increment x
    x = x + 1
    
    # sleep for 2 seconds,
    time.sleep(seconds_to_sleep)
    
    # display the value of x with print
    print(x)

# python interpreter only runs this function called main because we
# told it to at the bottom of the program
def main():
  
  # display the name of the program
  print("Python Multi-Threading Example")
  
  # declare a new list object,
  # something to hold our threads
  process_list = []
  
  # create an integer (a number)
  thread_counter = 0
  
  # get input from the user, I would read the next comment before you start!
  thread_target_count = input("enter the number of threads to start: ")
  #like on my computer it is a 24-thread machine, so I would enter 24
  
  # a while loop with some of our declared and inputed values...
  while thread_counter < thread_target_count:
  
    # the "defined" function that it runs is the target,
    # and it's from the multithreading module, and it's
    # the Process object of the multithreading imported module.
    process_list.append(multithreading.Process(target=add_and_display)
    
    # whatever thread we are on, thread_counter, start that thread
    process_list[thread_counter].start()
    
    # increment the thread counter as we have started and
    # created our current thread that we are on, next thread!
    thread_counter = thread_counter + 1
    

# common in all python programs we have at the end of
# the program this thing to start the main defined function,
# but you don't actually need this to start main, you could
# have just written main for some reason all python programs
# have this, I write it absentmindedly now i've written
# it so many times
if __name__ == '__main__':
  main()
  
Python

And that is the whole application which starts a bunch of threads that increment X, sleep for 2 seconds, and then display X. There’s only that to it, and python now rocks C++ like it is almost way better, and here this whole time I thought that they didn’t have it going on, I used to be the biggest supporter of python until I tried to do multi-threading and I either couldn’t get it to work or it actually didn’t work, I don’t know which one it was, but C++ had threads so I just had to write my programs in C++ the whole time. I never thought python would ever allow for there to be multiple instances of the interpreter (that’s what multithreading is on python), it’s the whole interpreter copied however many threads you start, or in this case however many processes that you start

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *