2 messages in com.mysql.lists.mysqlThreads related issues.| From | Sent On | Attachments |
|---|---|---|
| Alvin Starr | 05 May 1999 06:12 | |
| Michael Widenius | 10 May 1999 22:28 |
| Subject: | Threads related issues.![]() |
|---|---|
| From: | Alvin Starr (alv...@iplink.net) |
| Date: | 05/05/1999 06:12:30 AM |
| List: | com.mysql.lists.mysql |
In trying to find a thread problem in linuxthreads on alpha I noticed a possible optimazation point.
Thread creation requires several system calls and the allocation of memory on the stack of the running process. Thread termination has about the same overhead. I was wondering if it would not make sense to keep created threads around for reuse instead of terminating them. This would avoid the overhead of creating the new ones. Even though the cost of a clone in linux is not nearly as high as a fork there will still be sugnificant overhead. I expect that the same holds true for any other OS that supports threads as kernel/user processes.
One idea would be to do somthing like the Apache pre-forking where a minimum number of threads is keept around all the time and any idle threads over that limit will after some timeout be released. This would mean that in high traffic times the number of live threads would rise and then slowly decay when the threads are no longer used.
Just my thoughts.
Alvin Starr || voice: (416)585-9971 Interlink Connectivity || fax: (416)585-9974 alv...@iplink.net ||




