Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
27cb3d93
Commit
27cb3d93
authored
Oct 28, 2005
by
petr@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge pchardin@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/cps/mysql/trees/mysql-5.0-virgin
parents
314a33c8
922cdfa0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
9 deletions
+49
-9
server-tools/instance-manager/listener.cc
server-tools/instance-manager/listener.cc
+4
-3
server-tools/instance-manager/manager.cc
server-tools/instance-manager/manager.cc
+6
-6
server-tools/instance-manager/priv.cc
server-tools/instance-manager/priv.cc
+35
-0
server-tools/instance-manager/priv.h
server-tools/instance-manager/priv.h
+4
-0
No files found.
server-tools/instance-manager/listener.cc
View file @
27cb3d93
...
@@ -362,12 +362,13 @@ void Listener_thread::handle_new_mysql_connection(Vio *vio)
...
@@ -362,12 +362,13 @@ void Listener_thread::handle_new_mysql_connection(Vio *vio)
pthread_attr_t
mysql_thd_attr
;
pthread_attr_t
mysql_thd_attr
;
pthread_attr_init
(
&
mysql_thd_attr
);
pthread_attr_init
(
&
mysql_thd_attr
);
pthread_attr_setdetachstate
(
&
mysql_thd_attr
,
PTHREAD_CREATE_DETACHED
);
pthread_attr_setdetachstate
(
&
mysql_thd_attr
,
PTHREAD_CREATE_DETACHED
);
if
(
pthread_create
(
&
mysql_thd_id
,
&
mysql_thd_attr
,
mysql_connection
,
if
(
set_stacksize_n_create_thread
(
&
mysql_thd_id
,
&
mysql_thd_attr
,
mysql_thread_args
))
mysql_connection
,
mysql_thread_args
))
{
{
delete
mysql_thread_args
;
delete
mysql_thread_args
;
vio_delete
(
vio
);
vio_delete
(
vio
);
log_error
(
"handle_one_mysql_connection(): pthread_create(mysql) failed"
);
log_error
(
"handle_one_mysql_connection():"
"set_stacksize_n_create_thread(mysql) failed"
);
}
}
pthread_attr_destroy
(
&
mysql_thd_attr
);
pthread_attr_destroy
(
&
mysql_thd_attr
);
}
}
...
...
server-tools/instance-manager/manager.cc
View file @
27cb3d93
...
@@ -162,12 +162,12 @@ void manager(const Options &options)
...
@@ -162,12 +162,12 @@ void manager(const Options &options)
pthread_attr_init
(
&
listener_thd_attr
);
pthread_attr_init
(
&
listener_thd_attr
);
pthread_attr_setdetachstate
(
&
listener_thd_attr
,
PTHREAD_CREATE_DETACHED
);
pthread_attr_setdetachstate
(
&
listener_thd_attr
,
PTHREAD_CREATE_DETACHED
);
rc
=
pthread_create
(
&
listener_thd_id
,
&
listener_thd_attr
,
listene
r
,
rc
=
set_stacksize_n_create_thread
(
&
listener_thd_id
,
&
listener_thd_att
r
,
&
listener_args
);
listener
,
&
listener_args
);
pthread_attr_destroy
(
&
listener_thd_attr
);
pthread_attr_destroy
(
&
listener_thd_attr
);
if
(
rc
)
if
(
rc
)
{
{
log_error
(
"manager():
pthread_create
(listener) failed"
);
log_error
(
"manager():
set_stacksize_n_create_thread
(listener) failed"
);
goto
err
;
goto
err
;
}
}
...
@@ -187,12 +187,12 @@ void manager(const Options &options)
...
@@ -187,12 +187,12 @@ void manager(const Options &options)
pthread_attr_init
(
&
guardian_thd_attr
);
pthread_attr_init
(
&
guardian_thd_attr
);
pthread_attr_setdetachstate
(
&
guardian_thd_attr
,
PTHREAD_CREATE_DETACHED
);
pthread_attr_setdetachstate
(
&
guardian_thd_attr
,
PTHREAD_CREATE_DETACHED
);
rc
=
pthread_create
(
&
guardian_thd_id
,
&
guardian_thd_attr
,
guardian
,
rc
=
set_stacksize_n_create_thread
(
&
guardian_thd_id
,
&
guardian_thd_attr
,
&
guardian_thread
);
guardian
,
&
guardian_thread
);
pthread_attr_destroy
(
&
guardian_thd_attr
);
pthread_attr_destroy
(
&
guardian_thd_attr
);
if
(
rc
)
if
(
rc
)
{
{
log_error
(
"manager():
pthread_create
(guardian) failed"
);
log_error
(
"manager():
set_stacksize_n_create_thread
(guardian) failed"
);
goto
err
;
goto
err
;
}
}
...
...
server-tools/instance-manager/priv.cc
View file @
27cb3d93
...
@@ -18,6 +18,17 @@
...
@@ -18,6 +18,17 @@
#include "priv.h"
#include "priv.h"
#include "portability.h"
#include "portability.h"
#if defined(__ia64__) || defined(__ia64)
/*
We can live with 32K, but reserve 64K. Just to be safe.
On ia64 we need to reserve double of the size.
*/
#define IM_THREAD_STACK_SIZE (128*1024L)
#else
#define IM_THREAD_STACK_SIZE (64*1024)
#endif
/* the pid of the manager process (of the signal thread on the LinuxThreads) */
/* the pid of the manager process (of the signal thread on the LinuxThreads) */
pid_t
manager_pid
;
pid_t
manager_pid
;
...
@@ -52,3 +63,27 @@ unsigned int test_flags= 0;
...
@@ -52,3 +63,27 @@ unsigned int test_flags= 0;
unsigned
long
bytes_sent
=
0L
,
bytes_received
=
0L
;
unsigned
long
bytes_sent
=
0L
,
bytes_received
=
0L
;
unsigned
long
mysqld_net_retry_count
=
10L
;
unsigned
long
mysqld_net_retry_count
=
10L
;
unsigned
long
open_files_limit
;
unsigned
long
open_files_limit
;
/*
Change the stack size and start a thread. Return an error if either
pthread_attr_setstacksize or pthread_create fails.
Arguments are the same as for pthread_create().
*/
int
set_stacksize_n_create_thread
(
pthread_t
*
thread
,
pthread_attr_t
*
attr
,
void
*
(
*
start_routine
)(
void
*
),
void
*
arg
)
{
int
rc
;
/*
Set stack size to be safe on the platforms with too small
default thread stack.
*/
rc
=
pthread_attr_setstacksize
(
attr
,
(
size_t
)
(
PTHREAD_STACK_MIN
+
IM_THREAD_STACK_SIZE
));
if
(
!
rc
)
rc
=
pthread_create
(
thread
,
attr
,
start_routine
,
arg
);
return
rc
;
}
server-tools/instance-manager/priv.h
View file @
27cb3d93
...
@@ -80,4 +80,8 @@ extern unsigned long bytes_sent, bytes_received;
...
@@ -80,4 +80,8 @@ extern unsigned long bytes_sent, bytes_received;
extern
unsigned
long
mysqld_net_retry_count
;
extern
unsigned
long
mysqld_net_retry_count
;
extern
unsigned
long
open_files_limit
;
extern
unsigned
long
open_files_limit
;
int
set_stacksize_n_create_thread
(
pthread_t
*
thread
,
pthread_attr_t
*
attr
,
void
*
(
*
start_routine
)(
void
*
),
void
*
arg
);
#endif // INCLUDES_MYSQL_INSTANCE_MANAGER_PRIV_H
#endif // INCLUDES_MYSQL_INSTANCE_MANAGER_PRIV_H
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment