[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[JDEV] Threading and Jabber (fyi)
The next major change in the current codebase is going to be the
integration of threading. This will help a great deal in the performance,
internal structure, and reduce the existing bugs of IO.
Fortunately, the timing is perfect as Ralf has released unto the world an
amazing little package called PTH: GNU Portable Threads. Check it out
here: http://www.gnu.org/software/pth/pth.html and here is an extract from
that page:
"PTH is a very portable POSIX/ANSI-C based library for Unix platforms
which provides non-preemptive scheduling for multiple threads of execution
("multithreading") inside server applications. All threads run in the same
address space of the server application, but each thread has it's own
individual program-counter, run-time stack, signal mask and errno
variable."
"The thread scheduling itself is done in a cooperative way, i.e. the
threads are managed by a priority- and event-based non-preemptive
scheduler. The intention is that this way one can achieve better
portability and run-time performance than with preemptive scheduling. The
event facility allows threads to wait until various types of events occur,
including pending I/O on filedescriptors, asynchronous signals, elapsed
timers, pending I/O on message ports, thread and process termination, and
even customized callback functions."
The structure of PTH compliments Jabber's IO demands perfectly(one thread
per socket). I'm planning on having this working within Jabber yet this
month.
Jer