Opened 5 years ago

Last modified 5 years ago

#3606 new change

[meta] Switch to single-threaded apartment threading model for our BHO

Reported by: sergz Assignee:
Priority: P3 Milestone:
Module: Adblock-Plus-for-Internet-Explorer Keywords: meta
Cc: eric@…, oleksandr Blocked By:
Blocking: Platform: Internet Explorer
Ready: no Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

Description (last modified by sergz)


Right now we have ThreadingModel="both" for the BHO. It causes a lot of difficulties and questions.

Having single apartment threading should simplify at least dealing with IObjectWithSite and browser events. However it does not solve the hack based on current thread ID which is used to obtain a root document URL from WBPassthruSink::BeginningTransaction.

What to do

Investigate whether it's possible and if so plan it and implement.

Additional note

It seems indeed already runs in a single-threaded apartment because at the beginning of SetSite we call CoInitialize which Initializes the COM library on the current thread and identifies the concurrency model as single-thread apartment (STA), so it seems the threading model is indeed already STA.

Change History (4)

comment:1 Changed 5 years ago by sergz

  • Summary changed from [meta] Switch to single apartment threading model for our BHO to [meta] Switch to single-threaded apartment threading model for our BHO

comment:2 Changed 5 years ago by sergz

  • Description modified (diff)

comment:3 Changed 5 years ago by eric@…

We should switch our COM threading policy to "multithreaded". Changing it to single threaded will do nothing but create invisible performance bottlenecks.

comment:4 Changed 5 years ago by oleksandr

  • Platform changed from Unknown / Cross platform to Internet Explorer
  • Priority changed from Unknown to P3
Note: See TracTickets for help on using tickets.