This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: Improve performance of gthr-win32


cgf wrote:
| On Thu, Apr 22, 2004 at 09:45:24PM +0100, Danny Smith wrote:
| >From: "Wu Yongwei"
| >
| >| > From: "Wu Yongwei"
| >| >
| >| > | I have finally got the notification that my gcc assignment has been
| >| > | received by the GNU copyright clerk. So I am reposting the updated
| >| > | patch here.
| >| > |
| >| > | Hope it is OK.
| >| > |
| >| >
| >| > Looks OK to me but...
| >| >
| >| > ChangeLog entry is needed.
| >|
| >| 2004-04-22  Wu Yongwei  <adah@sh163.net>
| >|
| >| * gthr-win32.h (__gthread_mutex_t): New structure.
| >| (__GTHREAD_MUTEX_INIT_DEFAULT): New initialization value.
| >| (__gthread_mutex_init_function, __gthread_mutex_lock,
| >| __gthread_mutex_trylock, __gthread_mutex_unlock): Use a new (faster)
| >| mutex implementation.
| >| * config/i386/gthr-win32.c (__gthread_mutex_init_function,
| >| __gthread_mutex_lock, __gthread_mutex_trylock,
| >| __gthread_mutex_unlock): Ditto.
| >|
| >| > How has this been tested?
| >|
| >| Is the previous test enough?  I have tested again.
| >
| >What about results of bootstrap and checking gcc and libstdc++
| >testsuites?
|
| Danny, once you are satisfied with this patch, please feel free to
| check it in.
|
| cgf

I have committed to trunk after successful bootstrap (c,c++,objc,java,f77) and
regtesting on i386-pc-mingw32.  I also tested the libstdc++ testsuite with -mthreads added
to options.  No
regressions.


I have modified ChangeLog entry to:

2004-04-27  Wu Yongwei  <adah@sh163.net>

        * gthr-win32.h (__gthread_mutex_t): Change typedef to new structure.
        (__GTHREAD_MUTEX_INIT_DEFAULT): Adjust.
        (__gthread_mutex_init_function): Replace CreateMutex with
        initialization of custom mutex using CreateSemaphore.
        (__gthread_mutex_lock): Use InterlockedIncrement.
        (__gthread_mutex_trylock): Use InterlockedCompareExchange.
        (__gthread_mutex_unlock): Use InterlockedDecrement and
        ReleaseSemaphore to unlock.
        * config/i386/gthr-win32.c (__gthread_mutex_init_function,
        __gthread_mutex_lock, __gthread_mutex_trylock,
        __gthread_mutex_unlock): Adjust to match inline versions in
        gthr-win32.h.


Thanks Wu

Danny



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]