LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-30-2005, 10:18 AM   #1
sledhead
LQ Newbie
 
Registered: Apr 2005
Location: Calgary, AB
Distribution: Debian
Posts: 1

Rep: Reputation: 0
Question Is curses pthread safe?


I have written a multi-threaded program to test 1+ serial ports. The main thread will create individual port testing threads and ends in the main loop will use curses to display the Communication and error statistics for each port.

The problem I am observing is when I am writing to the logical screen. The column is nearly always wrong. I suspect the other threads are somehow interfering with the curses writes in the main thread.

If this is the problem, does anyone know a way to make this work, or do I need to create a separate program for curses?

sledhead
 
Old 04-30-2005, 11:30 AM   #2
grupoapunte
LQ Newbie
 
Registered: Apr 2005
Posts: 26

Rep: Reputation: 15
Thumbs up

Hi, I have designed a program using ptherads and curses, and nothing goes wrong with it, meke sure that all de user interface is in only one of the threads, cuz other way you will have to sincronize the curses functions so that thread swaping dosent afect the order of the things you want to show, and remamber using getxy() functions for posisionating the cursor.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
do I need curses? jake_01 Programming 1 04-28-2005 06:24 AM
Where is curses.h and semun.h DavidW567 Programming 1 01-13-2005 11:57 AM
curses and some terminals dimm_coder Programming 9 05-10-2004 11:04 AM
curses and iostream irfanhab Programming 3 05-10-2004 10:14 AM
Curses nitinkatageri Linux - General 2 08-18-2003 04:58 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration