Opened on 02/01/2016 at 03:58:32 PM

Last modified on 02/10/2016 at 06:27:10 AM

#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.

Attachments (0)

Change History (4)

comment:1 Changed on 02/08/2016 at 12:20:40 PM 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 on 02/08/2016 at 01:21:01 PM by sergz

  • Description modified (diff)

comment:3 Changed on 02/08/2016 at 05:48:16 PM by

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 on 02/10/2016 at 06:27:10 AM by oleksandr

  • Platform changed from Unknown / Cross platform to Internet Explorer
  • Priority changed from Unknown to P3

Add Comment

Modify Ticket

Change Properties
as new .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from (none).
Next status will be 'reviewing'.
Note: See TracTickets for help on using tickets.