View topic - How to avoid multiple application accessing same port.
How to avoid multiple application accessing same port.
4 posts
• Page 1 of 1
How to avoid multiple application accessing same port.
Hi All,
I am using standard serial driver devc-ser8250 for serial communication with my hardware. I have observed that if first application is accessing port say /dev/ser1 then driver gives the handle for port sending /receive. But if another application also trys to open same port ( /dev/ser1) then driver gives handle for same port.
How to avoid multiple application access to same port. Also would like to inform that devc-ser8250 driver is based on io-char library. So developer does not have much control on code (there is no open(), close() etc calls in code).
I am using standard serial driver devc-ser8250 for serial communication with my hardware. I have observed that if first application is accessing port say /dev/ser1 then driver gives the handle for port sending /receive. But if another application also trys to open same port ( /dev/ser1) then driver gives handle for same port.
How to avoid multiple application access to same port. Also would like to inform that devc-ser8250 driver is based on io-char library. So developer does not have much control on code (there is no open(), close() etc calls in code).
- garyritu
- Active Member
- Posts: 58
- Joined: Fri May 22, 2009 7:09 am
RE: How to avoid multiple application accessing same port.
Hi All,
On Windows, once a port is open by one application, no other application have access to the same port. I too have observed in case of QNX, its not possible. Any explanation for this is highly appreciated.
On Windows, once a port is open by one application, no other application have access to the same port. I too have observed in case of QNX, its not possible. Any explanation for this is highly appreciated.
- anvesh
- Active Member
- Posts: 31
- Joined: Wed Dec 03, 2008 6:57 am
RE: How to avoid multiple application accessing same port.
Multiple threads or processes opening a device multiple times is correct and important Posix behavior. If you want to prevent this, you need a mechanism to prevent conflicts.
- maschoen
- QNX Master
- Posts: 2728
- Joined: Wed Jun 25, 2003 5:18 pm
RE: How to avoid multiple application accessing same port.
In QNX4 there was a way to determined if the serial port was already opened. I guess in QNX6 one could do what pidin fd does to determined if someone else has opened the port.
- mario
- QNX Master
- Posts: 4132
- Joined: Sun Sep 01, 2002 1:04 am
4 posts
• Page 1 of 1
Return to Realtime and Embedded
Who is online
Users browsing this forum: No registered users and 2 guests