On 19 Apr, Rodos scribbled:
->  I am writing an application in C on Linux.
->  
->  Here is my problem. There are three things the program does, writes out
->  to a serial port. Reads and writes to the parallel port, and
->  communicates with a database. The thing is that the serial and database
->  stuff might block or timeout for periods of time (say 1 to 10 seconds).
->  However I need to constantly poll the serial port for data.
->  
->  Therefore I am not sure as to the best way to architect my program.
->  First thing that comes to mind is threads, but that sounds to hard for
->  me (not that I have looked at it yet). Other things are forking 3 tasks
->  and getting them to comminute with each other (how I don't know yet).
->  
->  So what do you gals and guys recommend, is there a common way of doing
->  such things? Is there a good C/Unix book that I should get ASAP. I have
->  flipped through my Kernighan "The Unix Programming Environment" and it
->  has a bit on forking but not a lot.

select(); is your friend. it sure as hell is mine :) 
man 2 select 

->  Thanks for the advise.
->  
->  Rodos
->  
->  P.S. I have ODBC working straight to an NT machine from my C program.
->  Way cool. I will be able to turf out more NT machines on this projects
->  and future ones when it is mandated that MS SQL is the database
->  platform. I am planning on writing a very small howto type thing on it.
->  
->  --
->  If the box says "Windows 95 or better", it should run on Linux, right?
->  - anon
->  --
->  SLUG - Sydney Linux Users Group Mailing List - http://www.slug.org.au
->  To unsubscribe send email to [EMAIL PROTECTED] with
->  unsubscribe in the text

-- 
--------------- Codito, ergo sum - "I code, therefore I am" --------------------
The Rasterman (Carsten Haitzler)    [EMAIL PROTECTED]     [EMAIL PROTECTED]
                                    [EMAIL PROTECTED] [EMAIL PROTECTED]
                                    [EMAIL PROTECTED]

--
SLUG - Sydney Linux Users Group Mailing List - http://www.slug.org.au
To unsubscribe send email to [EMAIL PROTECTED] with
unsubscribe in the text

Reply via email to