ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/cfperl.xs
(Generate patch)

Comparing deliantra/server/server/cfperl.xs (file contents):
Revision 1.270 by root, Sat Mar 15 13:52:38 2008 UTC vs.
Revision 1.271 by root, Tue Apr 1 19:50:39 2008 UTC

24#include "autoconf.h" 24#include "autoconf.h"
25 25
26#define PLUGIN_NAME "perl" 26#define PLUGIN_NAME "perl"
27#define PLUGIN_VERSION "cfperl 0.5" 27#define PLUGIN_VERSION "cfperl 0.5"
28 28
29#define CEDES_PER_TICK 5 29#define CEDES_PER_TICK 3
30 30
31#if HAVE_EXECINFO_H 31#if HAVE_EXECINFO_H
32# include <execinfo.h> 32# include <execinfo.h>
33#endif 33#endif
34 34
1113{ 1113{
1114 cede_counter = 0; 1114 cede_counter = 0;
1115 1115
1116 cede (); 1116 cede ();
1117 1117
1118 next_cede += (TICK / CEDES_PER_TICK) * 0.99; 1118 next_cede += TICK / CEDES_PER_TICK;
1119 if (next_cede > SvNVx (sv_next_tick) - 0.02) 1119 if (next_cede > SvNVx (sv_next_tick) - 0.002)
1120 next_cede = SvNVx (sv_next_tick); 1120 next_cede = SvNVx (sv_next_tick);
1121} 1121}
1122 1122
1123void coroapi::do_cede_every () 1123void coroapi::do_cede_every ()
1124{ 1124{
1677void _exit (int status = EXIT_SUCCESS) 1677void _exit (int status = EXIT_SUCCESS)
1678 1678
1679#if _POSIX_MEMLOCK 1679#if _POSIX_MEMLOCK
1680 1680
1681int mlockall (int flags = MCL_CURRENT | MCL_FUTURE) 1681int mlockall (int flags = MCL_CURRENT | MCL_FUTURE)
1682 INIT:
1683 mallopt (M_PERTURB, 0xaa); // bug-workaround for linux glibc+mlockall+calloc
1682 1684
1683int munlockall () 1685int munlockall ()
1684 1686
1685#endif 1687#endif
1686 1688
2801extract_tags (object_thawer *self) 2803extract_tags (object_thawer *self)
2802 PPCODE: 2804 PPCODE:
2803 while (self->kw != KW_EOF) 2805 while (self->kw != KW_EOF)
2804 { 2806 {
2805 PUTBACK; 2807 PUTBACK;
2806 coroapi::cede_to_tick_every (5000); 2808 coroapi::cede_to_tick_every (500);
2807 SPAGAIN; 2809 SPAGAIN;
2808 2810
2809 if (self->kw == KW_tag) 2811 if (self->kw == KW_tag)
2810 XPUSHs (sv_2mortal (newSVpv_utf8 (self->get_str ()))); 2812 XPUSHs (sv_2mortal (newSVpv_utf8 (self->get_str ())));
2811 2813

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines