PThreads Q (revised)

Search this archive.

From: viscous liquid (viscous_liquid@yahoo.com)
Date: Fri 19 Apr 2002 - 14:46:39 IDT


--- Matan Ziv-Av <matan@svgalib.org> wrote:
> On kernel 2.2 pthreads uses SIGUSR1 and SIGUSR2.
> svgalib uses by default
> (at least since 1.4.1) SIGUNUSED and SIGPROF, which
> are both unused on
> my system. I compiled and run a few threaded svgalib
> programs, with no
> problem.
> If you use kernel 2.2, and your system does use
> those two signals, you
> need to recompile svgalib, and then you can't use
> pthread and svgalib
> together.
> 
> On kernel 2.4 pthreads uses two RT signals, so it
> can not conflict with
> svgalib. I run programs that use svgalib and pthread
> with no problems.
> 
> 
> This signals issue is non related to thread-safety
> issues.
> svgalib is not thread-safe, which means that if two
> threads of the same
> program make svgalib calls, it can easily crash the
> system.
> The solution I use is to have a single thread that
> calls svgalib
> functions. All the other threads only write to
> (linear) video memory.

I apologize for improperly phrasing the Q. Thank you
Matan for correcting me. First let me first state that
I have not tried to use svgalib with pthreads, I just
thought about. Second the reason for posing the Q was
because I have been on the list for sometime I had
noticed there have been problems with svgalib and
pthreads. I apologize that I did not research the Q a
little better. I thought that the problem with svgalib
and pthreads was conflict of signals, but as Matan
pointed out to me. The conflict is that svgalib is not
thread safe. So now let me revise the original Q and
state it as follow, Is there a way that svgalib could
be made thread safe? Now Matan has stated how one
could avoid the conflicts buy utilizing the linear
memory. Can anyone think of a better way that could be
implemented in the library itself?

Have a nice day ;-)
Daniel Smith
viscous_liquid@yahoo.com

__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

------------------------------------------------------------------
Unsubscribe:  To:   listbot@svgalib.org
              Body: unsubscribe linux-svgalib


This archive was generated by hypermail 2.1.4 : Wed 21 Jan 2004 - 22:10:24 IST