nsLoggingService thread safe

RESOLVED INVALID

Status

()

Core
XPCOM
P3
enhancement
RESOLVED INVALID
17 years ago
8 years ago

People

(Reporter: Rick Marvin, Unassigned)

Tracking

Trunk
Future
All
Windows 2000
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

17 years ago
There's no way to currently have logging services and use xpcom in a
separate thread.

Currently the nsLoggingService::gLoggingService is initialized even before
XPCOM is started. When I attempt to NS_InitXPCOM in a child thread,
nsLoggingService asserts as the owning thread is not the current thread.

At first glance, this may seem logical, however, let me explain what I am
after, and then you might have a better understanding of the situation.

I desire to use the Necko engine as my network engine.  The network traffic
is secondary to the application, and it should all run in the background (on
a child thread simply retrieving urls on an interval basis).  Because the
necko engine uses other services which are not thread safe (namely the
nsCategoryManager and nsAppFileLocationProvider) I must initialize XPCOM
within the same thread that I intend to perform the necko operations.  That 
means starting up XPCOM in the child thread.  With the limitation that 
nsLoggingService starts up in the main thread, there is no way to use logging 
services while running XPCOM in a child thread.

In addition, there is no environment variable hooked up in the build process to 
turn off logging.  Currently, one can only disable logging if the makefile is 
edited to add NS_DISABLE_LOGGING and NO_BUILD_REFCNT_LOGGING

Comment 1

17 years ago
Marking NEW and adding RFE
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: nsLoggingService is not thread safe → [RFE] nsLoggingService thread safe

Updated

17 years ago
Summary: [RFE] nsLoggingService thread safe → nsLoggingService thread safe

Comment 2

16 years ago
taking some of the bugs that I have been working on from scc.
Assignee: scc → dougt

Updated

16 years ago
Target Milestone: --- → mozilla1.1

Updated

16 years ago
Blocks: 101976

Updated

16 years ago
Target Milestone: mozilla1.1alpha → Future

Comment 3

15 years ago
Does this bug still mean anything? I can find nsLoggingService or
gLoggingService anywhere in LXR...

Updated

12 years ago
QA Contact: kandrot → nobody
Assignee: dougt → nobody
QA Contact: nobody → xpcom

Updated

8 years ago
Status: NEW → RESOLVED
Last Resolved: 8 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.