bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: printw() and pthreads


From: Thomas Dickey
Subject: Re: printw() and pthreads
Date: Sun, 16 Dec 2007 19:11:14 -0500 (EST)

On Fri, 14 Dec 2007, ChCarver wrote:

I believe the issue is inside printw(). That when the thread is suspended
for the console thread and then returned a duplicate character is placed to
the screen.

Actually it sounds as if you're going into the display code more than
once.  You're presumably aware that ncurses is not thread-safe(*) - have
to wrap your calls appropriately.

Question: To get around this will I need to start using mvaddch() as that
places the character at an absolute position, where as printw() might be
incrementing a position. The reason I went with printw() was it handled the
scrolling for me. If I start using mvaddch(), how do I get the window to
still scroll to the next line?

addch would wrap - but combined with moving on each addch call, that's
not straightforward...

(*) I've been making changes in that area, but am stuck on a change where
    a recursive mutex is blocking itself ;-)

--
Thomas E. Dickey
http://invisible-island.net
ftp://invisible-island.net




reply via email to

[Prev in Thread] Current Thread [Next in Thread]