On Tue, Jul 7, 2009 at 7:57 AM, Cedric BAIL<[email protected]> wrote:
> On Tue, Jul 7, 2009 at 10:39 AM, Abhishek Bajpai<[email protected]> wrote:
>> I am working on Edge/ Evas project. Where I am using Multiple Threads. I
>> want to update the canvas from a different thread. But the problem I am
>> facing is that the Canvas gets updated only when I touches the screen.
>
>> Do you have any idea. I have read some were that Evas /EFL is not thread
>> safe. Then how to do that ?????
>
> Yes, you should never touch Evas from outside of the thread that
> created it. The solution to your problem would be to synchronize your
> Evas with another thread at some point. If you use Ecore main loop,
> you can just create a pipe and use an Ecore fd handler
> (ecore_main_fd_handler_add). When you have a result from your
> computation thread, just write something to the pipe, this will start
> the corresponding Ecore event at some point in the main loop, in which
> you can touch your Edje/Evas objects.


This is true not only for evas, but ALL EFL. Do not use Ecore, Edje,
Embryo, Eet and even Eina from different threads, unless stated so. In
this case, the only API I remember being thread-safe is
ecore_pipe_write(). You create it on main thread with ecore_pipe_add()
and can (should) use ecore_pipe_write() from your worker thread.
Everything else should not be used from threads.

For example, if you're using Eina with standard mempool, lists will be
corrupted if used from other threads: its nodes will be allocated from
the pool without any locking, so two threads can get the same node
memory chunk and you know bad things will happen.

-- 
Gustavo Sverzut Barbieri
http://profusion.mobi embedded systems
--------------------------------------
MSN: [email protected]
Skype: gsbarbieri
Mobile: +55 (19) 9225-2202

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have 
the opportunity to enter the BlackBerry Developer Challenge. See full prize 
details at: http://p.sf.net/sfu/blackberry
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to