--- In [email protected], "Geert Vancompernolle"
<[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> Is it harmful (wrt speed, optimization, resources) to have lots of
file
> descriptors (say, approx. 200) open to the same device?
>
> I'm currently having an application in C++, for which each and
every
> instance of different classes is opening one and the same device
(I2C
> driver), resulting in a "unique" file descriptor pointing to the
same
> device, for each and every object instance.
>
> I know the default max. file descriptors for the FoxBoard is set
to 8192
> (cat /proc/sys/fs/file-max), so that should not be the problem.
But the
> other things (speed, optimization, resources,...) might...
>
> Hence, asking for some advice.
>
> Best rgds,
>
> --Geert
>
Hi,
It may not be a problem but you'd better use a unique and global
object in your library, wich handle the file descriptor. You have
the "singleton" pattern design is typicaly for this kind of project.
You can find information about this on every C++/POO web site.
Best regards