Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.c++ > #14546
| Date | 2012-02-27 16:42 +0100 |
|---|---|
| From | Willy <gruppi@willygroup.org> |
| Newsgroups | comp.lang.c++ |
| Subject | Re: Troubles when processes try to access to a char device |
| References | <4f4b37c7$1@extreme.x-privat.org> <b3e184a9-e202-4d49-a936-272876efdc51@l14g2000vbe.googlegroups.com> <4f4b8821$2@extreme.x-privat.org> <897e745f-3360-4bde-a44a-da19341ba53b@gw9g2000vbb.googlegroups.com> |
| Message-ID | <4f4ba44d$1@extreme.x-privat.org> (permalink) |
| Organization | X-Privat.Org NNTP Server - http://www.x-privat.org |
Il 27/02/2012 16:08, gwowen ha scritto: > presumably > int fd; > > That'll probably be your issue. By default, file descriptors only have > meaning on a per-process basis. > So if two separate processes use the same integer descriptor, they > won't be reading from the same stream - and all the shared memory > segment shares is the integer. > > There are mechanisms for sharing file-descriptors, fork()/exec() or > sendmsg()/recvmsg() are the most common, but they probably won't work > they way you want. > > The best bet may be for each process to open their own file descriptor > for the device, and for shared memory / IPC to coordinate the reads / > writes through some sort of mutual exclusion, but it all depends on > the access pattern you need. Thanks :) I've understood the problem: file descriptor isn't just an int! Now I'm trying to find out the best solution. -- *Willy* - *Contatti*: http://snipurl.com/contatti * *FAQ* di /it-alt.comp.software.mozilla/: http://www.FAQmozilla.org * *Gratuiki* - Software Free: http://gratuiki.willygroup.org
Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Troubles when processes try to access to a char device Willy <gruppi@willygroup.org> - 2012-02-27 08:58 +0100
Re: Troubles when processes try to access to a char device gwowen <gwowen@gmail.com> - 2012-02-27 05:19 -0800
Re: Troubles when processes try to access to a char device Willy <gruppi@willygroup.org> - 2012-02-27 14:41 +0100
Re: Troubles when processes try to access to a char device gwowen <gwowen@gmail.com> - 2012-02-27 07:08 -0800
Re: Troubles when processes try to access to a char device Willy <gruppi@willygroup.org> - 2012-02-27 16:42 +0100
Re: Troubles when processes try to access to a char device gwowen <gwowen@gmail.com> - 2012-02-27 09:29 -0800
Re: Troubles when processes try to access to a char device Dan Oxender <d?n.oxe????@gmail.com> - 2012-02-28 09:06 -0700
Re: Troubles when processes try to access to a char device Alain Ketterlin <alain@dpt-info.u-strasbg.fr> - 2012-02-27 14:38 +0100
csiph-web