[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-mac
Subject:    Re: [KDE/Mac] [CODE] Multithreaded SIGSEGV signal handling,
From:       Kurt Hindenburg <kurt.hindenburg () gmail ! com>
Date:       2011-09-25 13:26:03
Message-ID: B0FD005A-C28E-4BA4-A57F-D877A76C4106 () gmail ! com
[Download RAW message or body]


On Sep 25, 2011, at 8:34 AM, Jonas Bähr wrote:

> Hi,
> 
> Am 25.09.2011 um 01:37 schrieb Michael Pyne:
> 
> > [...]
> > With that said I don't think the code uses as many POSIX options as the rest
> > of KSharedDataCache (e.g. process-shared mutexes as unimplemented on Mac OS X)
> > but I wanted to give a chance for you guys to test the prototype code
> > beforehand and let me know if there's problems.
> > 
> > You'll want to compile with something like this:
> > $CXX -O2 -o sigcatcher -lrt -pthread sigcatcher.cpp
> 
> Here is the first issue: librt doesn't exist here (Mac OS X 10.5 "Leopard").
> However, the code compiles without the "-lrt".
> $ g++ -O2 -o sigcatcher -pthread sigcatcher.cpp
> $ g++ --version
> i686-apple-darwin9-g++-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5493)
> 
> > Make sure optimization is enabled to ensure volatile is used where it's
> > needed. Assuming everything works right you should get output like:
> > 
> > $ ./sigcatcher
> > Hello, World!
> > Got a result of 1
> > Exited thread
> > $
> 
> The next problem is, that sem_init(..) isn't implemented here.
> $ ./sigcatcher
> Error: sem_init: Function not implemented
> $
> 
> It seems that only named semaphores are implemented.
> I've changed this part of your code to use sem_open(..) instead [see attachment] \
> and then I get the expected result: <sigcatcher-sem_open.cpp>
> 
> 
> $ g++ -O2 -o sigcatcher-sem_open -pthread sigcatcher-sem_open.cpp
> $ ./sigcatcher-sem_open
> Hello, World!
> Got a result of 1
> Exited thread
> $

Same results as Jonas on Lion.

i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM \
build 2335.15.00)

Kurt


_______________________________________________
kde-mac@kde.org
List Information: https://mail.kde.org/mailman/listinfo/kde-mac
KDE/Mac Information: http://techbase.kde.org/index.php?title=Projects/KDE_on_Mac_OS_X


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic