Multiprocessing/ Multi threading example

Unbreakable
I have two questions.
I am using python using kite connect api to develop an intraday strategy.
1) To implement a strategy which analyses historical data and buying or selling simultaneously, which is better multi processing or multi threading?
2) Can anyone give me any sample code where above process is implemented?
  • vaibhavsharma13
    Python has GIL that blocks one thread when another is running ( a thread waiting for input/output does not block). Because of that, multithreading is not recommended for Python for CPU-intensive tasks.
    If your code has a lot of calculations, it is better to use multiprocessing.
  • Unbreakable
    Can anyone show me an example where multi processing is implemented?
Sign In or Register to comment.