brunolojor / jbrout

Automatically exported from code.google.com/p/jbrout
0 stars 0 forks source link

Use a separate thread for long operations #28

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This is a long-term suggestion. It stems from
http://jbrout.python-hosting.com/ticket/192 

Generally speaking, it would be useful to run long operations (load,
refresh...) in a separate thread, so that the user can continue to use
jBrout. I suggest implementing a "job queue" so that the user can add new
jobs to perform while a previous job is being processed. I furthermore
suggest that in mono-processor computers it would be wrong to process more
than one job at a time, this really should be implemented as a queue.

Original issue reported on code.google.com by davito...@gmail.com on 9 Jan 2009 at 8:02

GoogleCodeExporter commented 9 years ago
It's not as easy as you said ...
If we do that, we'll need to implement a really complex concurrency system to 
avoid
troubles :

what about if you decide to supress pictures while the thread is importing ?
what about if you start tagging while the thread is importing ?
...

I really think It will create a lot more issues ;-) ... and the code will be 
really
hard to maintain ... 

secondly :
I have a mono-processor ;-)
thirdly :
threads in python is an odd problem : it uses the GIL ... so with two heads : 
it will
work on one head only ... we should use process (not thread !), and it 
complicates
the task (communication between process is more complicate) !

Original comment by manat...@gmail.com on 9 Jan 2009 at 12:48

GoogleCodeExporter commented 9 years ago
I answered in the jBrout Google group

Original comment by davito...@gmail.com on 9 Jan 2009 at 1:37

GoogleCodeExporter commented 9 years ago
I should have included a link to the Google Groups thread. Here it is :
http://groups.google.com/group/jbrout/browse_frm/thread/e30c617ef0631845/9050d4c
9319c2aa6

Original comment by davito...@gmail.com on 10 Jan 2010 at 6:34