And, generally, how can I check, if perl caught a signal on memory allocating?
Generally, I think you're onto a loser here. Trying to make unsafe signals work is not easy, which is is why perl itself abandoned them about 10 years ago.
Normal perl builds use the OS's malloc() library, since its is likely to be superior to perl's own implementaion. You could of course build a perl with perl's malloc by using the -Dusemymalloc on the Configure commnand line, then you'd have a perl with a lockable malloc and rubbish performance.
Even then, you would still be able to do almost nothing in your signal handler, because just about anything you tried to do (apart now from malloc) would be unsafe.
Dave.
| [reply] |
I can't use safe signals, because most part of my wishes are connected with MySQL. As I know, MySQL methods in perl wouldn't be terminated, when perl will catch safe signal.
| [reply] |
Are these flags set in standard perl build for ubuntu?
On the system perl on my Ubuntu (12.04LTS), useithreads is defined, but usemymalloc is not:
sisyphus@sisyphus5-desktop:~$ perl -V:usemymalloc
usemymalloc='n';
sisyphus@sisyphus5-desktop:~$ perl -V:useithreads
useithreads='define';
sisyphus@sisyphus5-desktop:~$
(You'll want "usemymalloc='y'".)
I have built some other perls, but none with -Dusemymalloc.
Maybe you should build one ?
Cheers, Rob
| [reply] [d/l] |