Re: [Tutor] threading for each line in a large file, and doing it right

2018-04-25 Thread Alan Gauld via Tutor
On 25/04/18 09:27, Alan Gauld via Tutor wrote: >> for i in $(< massive_input.file); do >> time_intensive_stuff_in_bash i & disown >> : >> done > > Its the same except in bash you start a whole > new process so instead of using threading you > use concurrent. concurrent -> multiprocessin

Re: [Tutor] threading for each line in a large file, and doing it right

2018-04-25 Thread Alan Gauld via Tutor
On 25/04/18 03:26, Evuraan wrote: > Please consider this situation : > Each line in "massive_input.txt" need to be churned by the > "time_intensive_stuff" function, so I am trying to background it. What kind of "churning" is involved? If its compute intensive threading may not be the right answer

Re: [Tutor] threading for each line in a large file, and doing it right

2018-04-24 Thread Danny Yoo
> Please consider this situation : > Each line in "massive_input.txt" need to be churned by the > "time_intensive_stuff" function, so I am trying to background it. > > import threading > > def time_intensive_stuff(arg): ># some code, some_conditional >return (some_conditional) > > with open

[Tutor] threading for each line in a large file, and doing it right

2018-04-24 Thread Evuraan
Greetings! Please consider this situation : Each line in "massive_input.txt" need to be churned by the "time_intensive_stuff" function, so I am trying to background it. import threading def time_intensive_stuff(arg): # some code, some_conditional return (some_conditional) with open("massi