RE: [xml] Possible error reporting addition to the library



Good question.

The issue of multi-threading aren't limited to error handling, but let's
focus on those and see if we can't resolve it in general too.

I'd see the issues as:
1. Getting the error meant for a particular thread;
2. Different threads setting different error handling functions;
3. ?

So, what do we need to do to overcome these problems?

Possible answers:
1. Do nothing and say it is not thread safe.

2. Provide a per thread data structure to maintain the most recent error.
The error handler "looks up" the thread data structure and sets the
appropriate values (error ID, message, etc). Then the error access functions
(xmlGetErrorCode, etc) would return the value associated with the calling
thread's ID. This could possibly be expanded to maintain all information for
a particular thread (the DOM).

The problem with 2 is that you couldn't treat the DOM as a resource usable
by all threads (without some real finagling).

Just some quick thoughts. Let me know what you think.

Gene

-----Original Message-----
From: Aleksey Sanin [mailto:aleksey aleksey com]
Sent: Thursday, March 13, 2003 2:51 PM
To: Thompson Eugene
Cc: 'xml gnome org'
Subject: Re: [xml] Possible error reporting addition to the library


What about multiple threads?

Aleksey





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]