--- 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
>
I don't think that is a problem but you may use a singleton design
pattern for your file objet. The advantage is that you have a unique
instance of the objet, so just one file descriptor.
Best rdgs.

Reply via email to