Would a multi-point function be a function if it was caused inside a multi-point function? Python, threading



  • Example:

    def foo():
      bar()
    def bar():
      print("Hello world")
    for i in range (ThreadCount):
      thread = threading.Thread(target=foo)
    

    Will the bar be met by several flows, or is its enforcement going to the main flow?



  • Whether the challenges of functions in many flows or not depend on the function itself, if one flow is to be performed, add 10 more flows, each of which causes your function.

    Functions are not performed by several flows unless you send them clearly to several flows.

    target=foo Says after the flow start (if added) thread.start() Call your code, foo() I'm going to do it. foo() In turn, new flows may be created or a function may be transferred to another stream of Pitton founciation as arguments to other functions (as if target=foo Demonstrated.

    In your case bar() I'm just calling. foo() That's why naturally. bar() It'll be in the same flow as it is. foo()♪ If you'll miss it. foo() mainly flow, bar() It's going to be mostly flow.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2