threads, queues, and make
Anne Ogborn <[email protected]>
| Newsgroups | gmane.comp.ai.prolog.swi |
|---|---|
| Message-ID | <[email protected]> |
I'm writing a logger that runs in it's own thread and communicates via message queues. The logger keeps some running statistics. I don't want to assert these for performance reasons, so the separate thread is easiest. start_logger_thread :- message_queue_create(logger_response_queue), thread_create(logger_thread, _, [ alias(my_logger), detached(true) ]). The problem comes in maintaining a pleasant development environment. I'd like to continue to have make. update my code happily, but of course the thread and the message queue exist, and the system whines when I try to redefine them. At the moment I'm just catching the exception, but it'd be better to detect the existance of the queue before creating it. There doesn't seem to be a queue_exists?