It all depends on how much precision you need with your slider. If you need high precision you may need to use real time extensions such as RTAI (
http://www.aero.polimi.it/~rtai/), otherwise you might find the the slider doesn't respond smoothly on your system. Although threads would a decent solution without resorting to using real-time stuff, you can try the fork() system call to have the parallel port checking routine as a background process.
vague example (put this somewhere in your main):
int main(void) {
int cpid, status;
cpid = fork();
if (cpid < 0) {
exit(1); /* fork failed */
} else if (cpid == 0) { /* child process */
/* insert your parallel port reader function */
} else { /* parent process */
/* your stuff */
}
/* after your done with your stuff make sure to kill the child */
kill(cpid, SIGKILL);
wait(&status); /* wait for child to finish */
}
you may find this interesting:
http://www.linuxgazette.com/node/view/100