Hallo.
Sorry für die verspätet Antwort.
>Was steht in einem solchen Fall in den Dateien /proc/capi/*, also zum
Blei-
>stift imn /proc/capi/applications? Was sagt "lsof | grep capi"? Im
Falle der
>FRITZ!Card: Wie sieht der Modul-Count aus? Wie sehen die
Modul-Counts
>von kcapi und capi (lsmod) aus?
Es gibt kein /proc/capi/ Verzeichnis.
Mit einem "lsof | grep capi" , kriege ich die folgende Zeile, aber 195 mal
wiederholt! Hier sind die erste und die letzte.
mini_capi 22563 root
cwd DIR
22,3 192 99867
/root/MiniCAPI
mini_capi 22563 root
rtd DIR
22,3
512 2 /
mini_capi
22563 root txt
REG 22,3
26761 100202 /root/MiniCAPI/mini_capi
mini_capi
22563 root mem
REG 22,3
90989 100189 /lib/ld-2.2.5.so
mini_capi
22563 root mem
REG 22,3
102052 100188 /lib/i686/libpthread.so.0
mini_capi
22563 root mem
REG 22,3
33722 146610 /usr/lib/libcapi20.so.2.0.6
mini_capi
22563 root mem
REG 22,3
914129 26385
/usr/lib/libstdc++.so.5.0.0
mini_capi 22563 root
mem REG 22,3
176399 100187 /lib/i686/libm.so.6
mini_capi
22563 root mem
REG 22,3
41022 25100 /lib/libgcc_s.so.1
mini_capi
22563 root mem
REG 22,3
1312490 100186 /lib/i686/libc.so.6
mini_capi
22563 root 0u
CHR
136,1
3 /dev/pts/1
mini_capi 22563 root
1u CHR
136,1
3 /dev/pts/1
mini_capi 22563 root
2u CHR
136,1
3 /dev/pts/1
mini_capi 22563 root
3u CHR
68,0
29852 /dev/capi20
mini_capi 22563 root
5r FIFO
0,6
298777 pipe
mini_capi 22563 root 6w
FIFO
0,6
298777 pipe
.
.
.
mini_capi 22758 root
cwd DIR
22,3 192 99867
/root/MiniCAPI
mini_capi 22758 root
rtd DIR
22,3
512 2 /
mini_capi
22758 root txt
REG 22,3
26761 100202 /root/MiniCAPI/mini_capi
mini_capi
22758 root mem
REG 22,3
90989 100189 /lib/ld-2.2.5.so
mini_capi
22758 root mem
REG 22,3
102052 100188 /lib/i686/libpthread.so.0
mini_capi
22758 root mem
REG 22,3
33722 146610 /usr/lib/libcapi20.so.2.0.6
mini_capi
22758 root mem
REG 22,3
914129 26385
/usr/lib/libstdc++.so.5.0.0
mini_capi 22758 root
mem REG 22,3
176399 100187 /lib/i686/libm.so.6
mini_capi
22758 root mem
REG 22,3
41022 25100 /lib/libgcc_s.so.1
mini_capi
22758 root mem
REG 22,3
1312490 100186 /lib/i686/libc.so.6
mini_capi
22758 root 0u
CHR
136,1
3 /dev/pts/1
mini_capi 22758 root
1u CHR
136,1
3 /dev/pts/1
mini_capi 22758 root
2u CHR
136,1
3 /dev/pts/1
mini_capi 22758 root
3u CHR
68,0
29852 /dev/capi20
mini_capi 22758 root
5r FIFO
0,6
298777 pipe
mini_capi 22758 root 6w
FIFO
0,6
298777 pipe
mini_capi ist ein Programm, dass einfach Capi
Register und Release aufruft. Es wird ein Thread gestartet, der
Capi_wait_for_message aufruft. Die Idee war zu testen, ob ein Capi release
erlaubt, aus der Capi_wait_for_message Funktion tu kommen, ohne dass ein Message
empfangen worden ist. Es passiert aber nicht.
Falls es euch interessiert, hier ist der
Code:
#include <stdio.h>
#ifdef __linux__
#
include <pthread.h>
#else
# include
<windows.h>
#endif
#include <unistd.h>
#include
<stdlib.h>
#ifdef __linux__
extern "C" unsigned
capi20_register(unsigned, unsigned, unsigned, unsigned*);
extern "C" unsigned
capi20_release(unsigned);
extern "C" unsigned
capi20_waitformessage(unsigned, struct timeval*);
#else
extern "C"
{
__declspec(dllimport) unsigned WINAPI CAPI_RELEASE (unsigned
ApplId);
__declspec(dllimport) unsigned WINAPI CAPI_REGISTER (unsigned
MsgBufSize, unsigned MaxB3Connection, unsigned MaxB3Blks, unsigned MaxSizeB3,
unsigned*);
__declspec(dllimport) unsigned WINAPI CAPI_WAIT_FOR_SIGNAL
(unsigned ApplId);
}
#endif
unsigned
applid;
#ifdef
__linux__
void* proc(void* arg)
#else
DWORD WINAPI proc(LPVOID
arg)
#endif
{
#ifdef
__linux__
printf("Thread #%d:
before capi20_waitformessage\n",
(int)arg);
unsigned ret =
capi20_waitformessage(applid,
NULL);
printf("Thread #%d: after
capi20_waitformessage(%u) = 0x%x\n", (int)arg, applid,
ret);
#else
printf("Thread #%d:
before CAPI_WAIT_FOR_SIGNAL\n",
(int)arg);
unsigned ret =
CAPI_WAIT_FOR_SIGNAL(applid);
printf("Thread #%d: after CAPI_WAIT_FOR_SIGNAL(%u) = 0x%x\n", (int)arg, applid,
ret);
#endif
return
NULL;
}
int main(int argc, char *argv[])
{
#ifdef
__linux__
pthread_t
th;
#else
DWORD
th;
#endif
int count =
0;
while(true){
#ifdef
__linux__
printf("Process: before
capi20_register\n");
unsigned ret = capi20_register(1, 10, 2048,
&applid);
printf("Process: after capi20_register(%u) = 0x%x\n", applid,
ret);
#else
printf("Process: before
CAPI_REGISTER\n");
unsigned ret = CAPI_REGISTER(2048, 1, 10, 1024,
&applid);
printf("Process: after CAPI_REGISTER(%u) = 0x%x\n", applid,
ret);
#endif
if(ret){
printf("CAPI is not able to register another application. Press CTRL+C to stop
program\n");
while(true)
#ifdef
__linux__
sleep(1);
#else
Sleep(1000);
#endif
exit(1);
}
#ifdef
__linux__
pthread_create(&th, NULL, proc,
(void*)count++);
printf("Process: after
pthread_create\n");
#else
CreateThread(NULL, 0, proc, (void*)count++, 0,
&th);
printf("Process: after CreateThread\n");
#endif
#ifdef
__linux__
sleep(1);
#else
Sleep(1000);
#endif
#ifdef
__linux__
printf("Process: before
capi20_release\n");
pthread_t
th;
#else
DWORD
th;
#endif
int count =
0;
while(true){
#ifdef
__linux__
printf("Process: before
capi20_register\n");
unsigned ret = capi20_register(1, 10, 2048,
&applid);
printf("Process: after capi20_register(%u) = 0x%x\n", applid,
ret);
#else
printf("Process: before
CAPI_REGISTER\n");
unsigned ret = CAPI_REGISTER(2048, 1, 10, 1024,
&applid);
printf("Process: after CAPI_REGISTER(%u) = 0x%x\n", applid,
ret);
#endif
if(ret){
printf("CAPI is not able to register another application. Press CTRL+C to stop
program\n");
while(true)
#ifdef
__linux__
sleep(1);
#else
Sleep(1000);
#endif
exit(1);
}
#ifdef
__linux__
pthread_create(&th, NULL, proc,
(void*)count++);
printf("Process: after
pthread_create\n");
#else
CreateThread(NULL, 0, proc, (void*)count++, 0,
&th);
printf("Process: after CreateThread\n");
#endif
#ifdef
__linux__
sleep(1);
#else
Sleep(1000);
#endif
#ifdef
__linux__
printf("Process: before
capi20_release\n");
ret =
capi20_release(applid);
printf("Process: after capi20_release(%u) = 0x%x\n", applid,
ret);
#else
printf("Process: before
CAPI_RELEASE\n");
ret =
CAPI_RELEASE(applid);
printf("Process: after CAPI_RELEASE(%u) = 0x%x\n", applid,
ret);
#endif
#ifdef
__linux__
sleep(1);
#else
Sleep(000);
#endif
}
#ifdef
__linux__
sleep(5);
#else
Sleep(5000);
#endif
return
0;
}
Gruß,
Carlo
______________________________
Giancarlo
Boi
Speech Resources Integration
ATIP GmbH
Daimlerstraße 32
60314
Frankfurt am Main
fon: +49 (0)69 / 941963220
fax: +49 (0)69 /
941963188
email:Giancarlo.Boi@atip.de
http://www.atip.de