This is the mail archive of the 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: Eliminate uses of "sleep" in V3 testsuite

>As discussed previously, use of "sleep" as a synchronization primitive
>in the V3 testsuite is (a) bogus, and (b) slow.  This patch implements
>a semaphore class that is used instead.  The current implementation of
>the semaphore class uses System V IPC, but there's no reason it needs
>to do that; it could use some other synchronization primitive
>instead.  Since these tests already depend on "fork", we're clearly in
>the land of UNIX-like systems.

Sounds good.

Sorry I missed the beginning of this thread. Perhaps you've already
found this, but there has been some commentary about fixing this here:

I thought there was another thread too, but I cannot find it now.

It's nice to see you fixing this correctly! Also, thanks for posting your patch on this list.

>This change cuts about 1 minute off of the V3 test time for me.


>+   semaphore::semaphore ()

>+   semaphore::~semaphore ()

>+   void
>+   semaphore::wait() {
>+     struct sembuf op[1] = {
>+       { 0, -1, SEM_UNDO }
>+     };
>+     if (semop (sem_set_, op, 1) == -1)
>+       throw std::runtime_error ("could not wait for semaphore");
>+ #endif    
>+   }
>  }; // namespace __gnu_test

Aggggh. Pick a style, any style.... 

Please think about formatting this code consistently, and hopefully like
the rest of libstdc++ hackers do. Suggestion: see C++STYLE.


foo() not foo ()



something {

etc etc etc.

You need to update copyrights on files you touched for 2005.


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