![]() | |
![]() |
| | Thread Tools | Display Modes |
#11
| |||
| |||
|
|
Tom Lane wrote: Right. Depending on your OS you may be able to catch a signal that would kill a thread and keep it from killing the whole process, but this still leaves you with a process memory space that may or may not be corrupted. It is very common that you either get a null pointer exception (attempt to access address zero), that your stack will hit a write protected page (stack overflow), or that you get some sort of arithemtic exception. These conditions can be trapped and gracefully handled. |
|
I'm not sure I follow. You will be able to bring all threads of one process to a halt much faster than you can kill a number of external processes. |
#12
| |||
| |||
|
|
That argument has zilch to do with the question at hand. If you use a coding style in which these things should be considered recoverable errors, then setting up a signal handler to recover from them works about the same whether the process is multi-threaded or not. The point I was trying to make is that when an unrecognized trap occurs, you have to assume not only that the current thread of execution is a lost cause, but that it may have clobbered any memory it can get its hands on. I'm just arguing that far from all signals are caused by unrecoverable |
|
... The point here is circumscribing how much can go wrong before you realize you're in trouble. Ok now I do follow. With respect to my last comment about speed, I guess |
#13
| |||
| |||
|
|
So Thomas, you say you like the PostgreSQL process based modell better than the threaded one used by MySQL. But you sound like the opposite. I'd like to know why you like processes more. Ok, let me try and explain why I can be perceived as a scatterbrain :-). |
#14
| |||
| |||
|
#15
| |||
| |||
|
|
[processes vs threads stuff deleted] In any modern and reasonable Unix-like OS, there's very little difference between the multi-process or the multi-thread model. _Default_ behaviour is different, e.g. memory is shared by default for threads, but processes can share memory as well. There are very few features threads have that processes don't, and vice versa. And if the OS is good enough, there are hardly performance issues. Most servers have a desire to run on Windows-NT and I would consider |
|
I think that it would be interesting to discuss multi(processes/threades) model vs mono (process/thread). Mono as in _one_ single process/thread per CPU, not one per session. That is, moving all the "scheduling" between sessions entirely to userspace. The server gains almost complete control over the data structures allocated per session, and the resources allocated _to_ sessions. I think what you mean is user space threads. In the Java community known |
#16
| |||
| |||
|
|
Marco Colombo wrote: [processes vs threads stuff deleted] In any modern and reasonable Unix-like OS, there's very little difference between the multi-process or the multi-thread model. _Default_ behaviour is different, e.g. memory is shared by default for threads, but processes can share memory as well. There are very few features threads have that processes don't, and vice versa. And if the OS is good enough, there are hardly performance issues. Most servers have a desire to run on Windows-NT and I would consider Solaris a "modern and reasonable Unix-like OS". On both, you will find a significant performance difference. I think that's true for Irix as well. Your statement is very true for Linux based OS'es though. |
|
I think that it would be interesting to discuss multi(processes/threades) model vs mono (process/thread). Mono as in _one_ single process/thread per CPU, not one per session. That is, moving all the "scheduling" between sessions entirely to userspace. The server gains almost complete control over the data structures allocated per session, and the resources allocated _to_ sessions. I think what you mean is user space threads. In the Java community known as "green" threads, Windows call it "fibers". That approach has been more or less abandoned by Sun, BEA, and other Java VM manufacturers since a user space scheduler is confined to one CPU, one process, and unable to balance the scheduling with other processes and their threads. A kernel scheduler might be slightly heavier but it does a much better job. Regards, Thomas Hallgren |
#17
| |||
| |||
|
|
I mean an entirely event driven server. The trickiest part is to handle N-way. On 1-way, it's quite a clear and well-defined model. |
#18
| |||
| |||
|
|
I think that it would be interesting to discuss multi(processes/threades) model vs mono (process/thread). Mono as in _one_ single process/thread per CPU, not one per session. That is, moving all the "scheduling" between sessions entirely to userspace. The server gains almost complete control over the data structures allocated per session, and the resources allocated _to_ sessions. |
#19
| |||
| |||
|
|
Marco, I mean an entirely event driven server. The trickiest part is to handle N-way. On 1-way, it's quite a clear and well-defined model. You need to clarify this a bit. You say that the scheduler is in user-space, yet there's only one thread per process and one process per CPU. You state that instead of threads, you want it to be completely event driven. In essence that would mean serving one event per CPU from start to end at any given time. What is an event in this case? Where did it come from? How will this system serve concurrent users? |

|
Regards, Thomas Hallgren |
#20
| |||
| |||
|
|
Two: If a single process in a multi-process application crashes, that process alone dies. The buffer is flushed, and all the other child processes continue happily along. In a multi-threaded environment, when one thread dies, they all die. So this means that if a single connection thread dies in MySQL, all connections die? |
|
Seems rather serious. I am doubtful that is how they have implemented it. |
![]() |
| Thread Tools | |
| Display Modes | |
| |