List:General Discussion« Previous MessageNext Message »
From:Dan Nelson Date:February 20 2004 7:41pm
Subject:Re: Does thread_concurrency do anything on a non-Solaris OS?
View as plain text  
In the last episode (Feb 20), Bill Marrs said:
> Looking around in the docs, I found this regarding thread_concurrency:
> 
> thread_concurrency
> On Solaris, mysqld will call thr_setconcurrency() with this value. 
> thr_setconcurrency() permits the application to give the threads
> system a hint for the desired number of threads that should be run at
> the same time.
> 
> I had noticed that it is set to 10 on my system, though I only have 2
> CPUs (I've also seen that the recommended value is #CPUS*2.  So, I
> was considering dropping it to 4.  But, after reading the above, I
> wonder if it makes difference on a Linux system (or any other
> non-Solaris system).

thr_setconcurrency is an obsolete Solaris-only function. 
pthread_setconcurrency is the replacement.  This means that mysql can
only set concurrency on Solaris, and according to my reading of the
manpage on Solaris 9, the value passed to the thr_ version is ignored.

http://docs.sun.com/db/doc/816-0216/6m6ngupp2?a=view ( thr_ )
http://docs.sun.com/db/doc/816-0216/6m6nguplf?a=view ( pthread_ )

According to the glibc 2.3.2 documentation:

  pthread_setconcurrency is unused in LinuxThreads due to the lack of a
  mapping of user threads to kernel threads.  It exists for source
  compatibility.

It is supported to some degree on Tru64, AIX, and FreeBSD 5.x (with
libkse).  I don't know how much difference it makes to mysql.

http://www.freebsd.org/cgi/man.cgi?query=pthread_setconcurrency&manpath=FreeBSD+5.2-current&format=html
http://h30097.www3.hp.com/docs/base_doc/DOCUMENTATION/V51B_HTML/MAN/MAN3/2224____.HTM
http://www16.boulder.ibm.com/doc_link/en_US/a_doc_lib/libs/basetrf1/pthread_getconcurrency.htm

-- 
	Dan Nelson
	dnelson@stripped
Thread
Does thread_concurrency do anything on a non-Solaris OS?Bill Marrs20 Feb
  • Re: Does thread_concurrency do anything on a non-Solaris OS?Dan Nelson20 Feb