[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Auto-spawn in libspeechd questions
From: |
Luke Yelavich |
Subject: |
Auto-spawn in libspeechd questions |
Date: |
Thu, 15 Apr 2010 22:05:33 +1000 |
On Tue, Apr 13, 2010 at 10:00:07PM EST, Hynek Hanke wrote:
>
> Hello,
>
> the autospawn in libspeechd is a very nice thing. It's implemented
> as follows:
>
> g_spawn_sync(NULL, (gchar**)speechd_cmd, NULL,
> G_SPAWN_SEARCH_PATH | G_SPAWN_STDOUT_TO_DEV_NULL |
> G_SPAWN_STDERR_TO_DEV_NULL, NULL, NULL, NULL, NULL, &exit_status,
> &error);
> sleep(0.5);
>
> 1) Why is it necessary to sleep at all? Should not this be fixed in
> src/server/speechd.c?
That was a quick hack to ensure the speech server was ready by the time the
client was ready to attempt a connection to the server.
> If so, is one second enough?
Ultimately I think it is system dependant. However to truely solve this, we
would need to use a mechanism that can report back when the server is ready to
accept connections.
> 2) As per Glibc reference, sleep() takes unsigned int as argument,
> not float.
Fair call, but it worked and works, and I thought 1 second was too long a wait.
Luke