由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - Restaurant Reservation System...
相关主题
java里用synchronized包住block就可以保护多线程同步问题了,这就是c里面的mutex吧?精华区翻出来的MS老题,thread safe
编程题又一道Monitor和semaphore, mutex是什么关系?
pthread mutex能不能用与thread和process之间问个semaphore 和 mutex的问题
为什么说semaphore是一种进程间的通信方式。question about the read/write locker
about critical sectionc++是不是准备加一个glue layer把系统给隔离出来?
how to answer this question, thanks问一个读写锁的问题
mutex和semaphore的差别到底是什么?连续release mutex/semphore 2次有什么问题吗?
谁能推荐一个read-writer lock的C++实现? (转载)Multi-thread可以mutex锁资源,Multi-process怎么锁资源?
相关话题的讨论汇总
话题: system话题: restaurant话题: booking话题: semaphore
进入Programming版参与讨论
1 (共1页)
o******r
发帖数: 259
1
看到很多面试题都问这个,
有什么trick吗?
以前有道电梯设计拿process schedule类比,
这个饭店预订是什么来头呢?
m******t
发帖数: 2416
2
I guess you want to elaborate on how you would make sure it won't give the
same table to two parties at the same time? 8-)

【在 o******r 的大作中提到】
: 看到很多面试题都问这个,
: 有什么trick吗?
: 以前有道电梯设计拿process schedule类比,
: 这个饭店预订是什么来头呢?

o******r
发帖数: 259
3
我google到一个简单的uml design
就是轮询每张桌子,看能否满足指定时间的预订,
能就订上,并给个confirmation
这样太简单了吧?
如果是多个booking 操作同时进行,
加一个synchronization也可以了,
不过好象一般都是一个booking, 串行的.

【在 m******t 的大作中提到】
: I guess you want to elaborate on how you would make sure it won't give the
: same table to two parties at the same time? 8-)

p****s
发帖数: 32405
4
并行的, 这个用semaphore或mutex tasking的算法不行么?

【在 o******r 的大作中提到】
: 我google到一个简单的uml design
: 就是轮询每张桌子,看能否满足指定时间的预订,
: 能就订上,并给个confirmation
: 这样太简单了吧?
: 如果是多个booking 操作同时进行,
: 加一个synchronization也可以了,
: 不过好象一般都是一个booking, 串行的.

o******r
发帖数: 259
5
我指的就是用semaphore/mutex之类的来同步,
好象题目更偏重于OOP design
看你用什么object
往简单了说,一个booking, 一个table,一个confirmation
或加一个client GUI

【在 p****s 的大作中提到】
: 并行的, 这个用semaphore或mutex tasking的算法不行么?
1 (共1页)
进入Programming版参与讨论
相关主题
Multi-thread可以mutex锁资源,Multi-process怎么锁资源?about critical section
C++ InitializeCriticalSection问题how to answer this question, thanks
thread, semaphore, 问题。mutex和semaphore的差别到底是什么?
c++问题谁能推荐一个read-writer lock的C++实现? (转载)
java里用synchronized包住block就可以保护多线程同步问题了,这就是c里面的mutex吧?精华区翻出来的MS老题,thread safe
编程题又一道Monitor和semaphore, mutex是什么关系?
pthread mutex能不能用与thread和process之间问个semaphore 和 mutex的问题
为什么说semaphore是一种进程间的通信方式。question about the read/write locker
相关话题的讨论汇总
话题: system话题: restaurant话题: booking话题: semaphore