开发者

different types of synhronization methods in linux?

开发者 https://www.devze.com 2023-02-10 18:02 出处:网络
what are the di开发者_如何学JAVAfferent types snchronization methods ?(other than semaphore,mutex,binary semaphore)I\'m assuming that you\'re talking about application development and not Kernel devel

what are the di开发者_如何学JAVAfferent types snchronization methods ?(other than semaphore,mutex,binary semaphore)


I'm assuming that you're talking about application development and not Kernel development.

Linux supports Posix synchronization techniques. Some common ones are a mutex (for multi-threaded applications) and semaphores. You can use these in many ways... An example of semaphore usage would be multiple processes and keeping a semaphore in shared memory.

I recommend you do some reading of the following manpages:
sem_init
pthread_mutex_init

Also, here's a good discussion on the usage of file locking

Hope that helps.

0

精彩评论

暂无评论...
验证码 换一张
取 消