Sunday, January 03, 2010

NPAPI Plugin: Threading Model

https://wiki.mozilla.org/Plugins:PlatformIndependentNPAPI#Out_of_process_plugins
https://developer.mozilla.org/en/NPN_PluginThreadAsyncCall

The current NPAPI model defines the threading model within one process such that whatever thread invokes NPP_New is the only thread that may invoke NPN_* functions.


The one exception to NPN_* calls is NPN_PluginThreadAsyncCall.

The semantics of NPN_PluginThreadAsyncCall remain fundamentally the same, just with respect to P:
1.It can be called from any thread in P.
2.Invoking it eventually causes an NPP callback on Tp to func, passing userData.


The NPN_* can only be called by main plugin thread. To call NPN_* from spawned plugin thread, using the indirect way(set callback, waiting for main plugin thread to call).

No comments:

Related Posts Plugin for WordPress, Blogger...