unihd-cag / skillbridge

A seamless python to Cadence Virtuoso Skill interface
https://unihd-cag.github.io/skillbridge/
GNU Lesser General Public License v3.0
181 stars 38 forks source link

Two users can not use skillbridge at the same time on on machine #200

Closed ClarenceChee closed 1 year ago

ClarenceChee commented 2 years ago

Once start pyStartServer, a file /tmp/skill-server-default.sock will be created, if another user want to use skill bridge on this machine, there will be an error: PermissionError: [Errno 1] Operation not permitted: '/tmp/skill-server-default.sock'. Maybe the file should be created as /tmp/$user/skill-server-default.sock

TM90 commented 2 years ago

Hey,

Using one virtuoso instance with multiple users is not possible since we pipe commands to the Virtuoso CIW. And this will get mixed up if there are multiple clients.

What is possible is to start multiple virtuoso instances with different servers where different clients can connect to.

For this use case you can start a virtuoso server with an id and connect to the server with this id in the client.

https://unihd-cag.github.io/skillbridge/examples/multiple-instances.html

Hope that helps.

Best regards

ClarenceChee commented 2 years ago

Using one virtuoso instance with multiple users is not possible since we pipe commands to the Virtuoso CIW. And this will get mixed up if there are multiple clients.

Thanks for your reply. Yes we did start a virtuoso server with an id now as an alternative solution.
I am not mean to "Using one virtuoso instance with multiple users", but multiple users work at one machine with their own different virtuoso instances. Since every user will create a file /tmp/skill-server-default.sock, there will be a conflict, I am wondering if the file can be created as /tmp/$user/skill-server-default.sock to avoid the conflict between different users?

TM90 commented 2 years ago

Using one virtuoso instance with multiple users is not possible since we pipe commands to the Virtuoso CIW. And this will get mixed up if there are multiple clients.

Thanks for your reply. Yes we did start a virtuoso server with an id now as an alternative solution. I am not mean to "Using one virtuoso instance with multiple users", but multiple users work at one machine with their own different virtuoso instances. Since every user will create a file /tmp/skill-server-default.sock, there will be a conflict, I am wondering if the file can be created as /tmp/$user/skill-server-default.sock to avoid the conflict between different users?

Ok now i understand the problem.

We will look into in the course of the week.

Best regards

TM90 commented 1 year ago

For your use-case we recommend using ids. We will not automatically create ids based on users, since on Windows machines the communication and ID mechanism is quite different and we cannot do the same there.

If you want to simplify usage, we recommend using a slim skill wrapper function which uses the current user as id to start the server.

Best regards

Tobias

PiyushSaini07 commented 1 year ago

Just curious with the /tmp/skill-server-default.sock file - this is created once I start the python server. Is there a way to delete it automatically? Right now I'm deleting the file manually.

If you want to simplify usage, we recommend using a slim skill wrapper function which uses the current user as id to start the server.

I'm doing this for multiple users.

nielsbuwen commented 1 year ago

Unfortunately this is a bit tricky. The python server that is spawned by the Cadence-Tool should be responsible for deleting the socket file. When pyKillServer is typed into the CIW the server actually receives a signal and it could delete the file (it does not). But when virtuoso exits it does not tell the server. There does not seem to be an easy way to detect when your parent process has exited.

PiyushSaini07 commented 1 year ago

That makes sense, thanks for the clarification.