由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
JobHunting版 - Can a 10-year-Java guy answer these 2 questions promptly?
相关主题
Google电面被拒,郁闷中hashmap跟hash table有啥区别?
gg面试题C++ Singleton的实现
被鄙视了, c++基础知识问个c++的问题
刚才有个讨论singleton的帖子,找不到了singleton哪种写法好?
关于singleton 的面试题C++ Singleton Template - 编译通不过
singleton pattern problemCode for Singleton design pattern
请问一道special singleton class的题Palantir 2nd coding interview [pass, set for on-site]
问一个thread safe singleton的问题面试常考哪些java的design pattern
相关话题的讨论汇总
话题: java话题: singleton话题: mysingle话题: lock话题: static
进入JobHunting版参与讨论
1 (共1页)
e***a
发帖数: 1661
1
1. What is Java marker interface?
2. What new features have been added into the concurrency control
by Java 1.5, as compared to Java 1.4?
Can you answer these 2 questions promptly via the phone?
I am applying for a J2EE position, but got these 2 questions
from a phone interview by an Indian guy.
z****e
发帖数: 54598
2
狗日的阿三在故意刁难
估计没戏了
y*******o
发帖数: 6632
3
1. like serializable, it is mark the status or charateristics of a class
rather than providing a fucntional interface
2. lock, threadlocal, executor

【在 e***a 的大作中提到】
: 1. What is Java marker interface?
: 2. What new features have been added into the concurrency control
: by Java 1.5, as compared to Java 1.4?
: Can you answer these 2 questions promptly via the phone?
: I am applying for a J2EE position, but got these 2 questions
: from a phone interview by an Indian guy.

y*******o
发帖数: 6632
4
Read:Java Concurrency In Practice
just google, threadlocal is not
should be these four:
LOCK OBJECTS
Lock objects work very much like the implicit locks (monitors) used by
synchronized code. As with implicit locks, only one thread can own a Lock
object at a time. Lock objects also support a wait/notify mechanism, through
their associated Condition objects. All the lock objects are defined in the
java.util.concurrent.lock package. The biggest advantage of Lock objects
over implicit locks is their ability to back out of an attempt to acquire a
lock. The tryLock method backs out if the lock is not available immediately
or before a timeout expires (if specified). The lockInterruptibly method
backs out if another thread sends an interrupt before the lock is acquired.
EXECUTORS
The java.util.concurrent package defines three executor interfaces:
* Executor: A simple interface that supports launching new tasks.
* ExecutorService: A sub-interface of Executor, which adds features that
help manage the lifecycle, both of the individual tasks and of the executor
itself.
* ScheduledExecutorService: A sub-interface of ExecutorService, supports
future and/or periodic execution of tasks.
CONCURRENT COLLECTIONS
The java.util.concurrent package includes a number of additions to the Java
Collections Framework.
* BlockingQueue defines a first-in-first-out data structure that blocks
or times out when you attempt to add to a full queue, or retrieve from an
empty queue.
* ConcurrentMap is a subinterface of java.util.Map that defines useful
atomic operations. These operations remove or replace a key-value pair only
if the key is present, or add a key-value pair only if the key is absent.
The standard general-purpose implementation of ConcurrentMap is
ConcurrentHashMap, which is a concurrent analog of HashMap.
* ConcurrentNavigableMap is a subinterface of ConcurrentMap that
supports approximate matches. The standard general-purpose implementation of
ConcurrentNavigableMap is ConcurrentSkipListMap, which is a concurrent
analog of TreeMap.
ATOMIC VARIABLES

【在 y*******o 的大作中提到】
: 1. like serializable, it is mark the status or charateristics of a class
: rather than providing a fucntional interface
: 2. lock, threadlocal, executor

z****e
发帖数: 54598
5
google了一下,也不是太难
1.没有要求实现方法的interface统一叫做maker interface,本意是用这种方式告诉执
行的系统以关联一些原数据,比如一般情况下,大多数类是不会serializable,也就是
在不同虚拟机之间传递,会导致问题,所以要想让这个类在不同虚拟机之类传输正确,
就需要你去implements serializable这个接口,但是这个接口只是一个声明,不强制
要求你做任何事,系统看到这个interface之后,就会执行相关的操作,类似的还有
cloneable等等
2.java.util.concurrent
就是对于很多并发控制的优化
比如hashtable和hashmap
hashmap不是synchronized
但是hashtable是
所以就造成了hashtable的效率低下
所以后来的趋势就是用hashmap来替换掉hashtable
但是呢,这样做又有些不太安全
所以有必要的话,还是用concurrenthashmap
但是concurrenthashmap并不是synchronized的
或者说它synchronized的层次相对低级
只对一个数据做syncrhonized,而不限制其它的数据同时被访问
如果你有要求说在某一个线程访问时候,禁止其它数据被访问
那就有必要用到hashtable
简单说就是在hashmap和hashtable之间做了一个小小的折中方案
一方面又允许并发操作,同时又不是那么严格地限制并发操作
这两个问题都tmd冷门
第一个是在阿三的网站找到的,混蛋的阿三已经串联好了,然后用这个问题来拒人
第二个倒是有必要了解一下,对我来说
t**********h
发帖数: 2273
6
第一个是常规问题啊,顾名思义啊,尸位素餐的interface啊
第二个太宽了,真的,这里面很多门道啊,很多思想,比如singlton最终完美thread
safe版本里面用的double check都是从这个concurency里研究出来的。不好答啊,这个
题,md
w****u
发帖数: 3147
7
10年应该要答出来吧,如果一直做java的话
y*******g
发帖数: 6599
8
囧 刚学java的时候就1.6了怎么版啊

【在 e***a 的大作中提到】
: 1. What is Java marker interface?
: 2. What new features have been added into the concurrency control
: by Java 1.5, as compared to Java 1.4?
: Can you answer these 2 questions promptly via the phone?
: I am applying for a J2EE position, but got these 2 questions
: from a phone interview by an Indian guy.

i***e
发帖数: 452
9
囧的是面试官了, 直接告诉丫的俺开始学的时候已经1.6, 比你高几个档次!!

【在 y*******g 的大作中提到】
: 囧 刚学java的时候就1.6了怎么版啊
h****e
发帖数: 928
10
第一道题只要知道serialization就可以回答得出来。
第二道题如果准备过早年的SJCP可能也可以回答得出来。SJCP
有些题甚至问assert在1.3-1.5之间的变化是什么。但是这类问题
绝对是没有什么意义的。
目前Java学的还是1.5,更囧。
相关主题
singleton pattern problemhashmap跟hash table有啥区别?
请问一道special singleton class的题C++ Singleton的实现
问一个thread safe singleton的问题问个c++的问题
进入JobHunting版参与讨论
x*****p
发帖数: 1707
11
The two questions are quite basic and easy.
Especially the first one. There are 5 marker interfaces in Java
Cloneable, Serializable, EventListener, RandomAccess, SingleThreadModel
The second one in the concurrent package, there are two important
features. One is using thread pool patterns and it provides different
kinds of thread pools. The other is to use non-blocking algorithms for
thread-safe issue, for example, the atomic package APIs.

【在 e***a 的大作中提到】
: 1. What is Java marker interface?
: 2. What new features have been added into the concurrency control
: by Java 1.5, as compared to Java 1.4?
: Can you answer these 2 questions promptly via the phone?
: I am applying for a J2EE position, but got these 2 questions
: from a phone interview by an Indian guy.

l**s
发帖数: 421
12
singleton为什么要double check? 直接private static final Singleton singleton = new Singleton()不行吗?这样直接避免同步了啊 望指教

【在 t**********h 的大作中提到】
: 第一个是常规问题啊,顾名思义啊,尸位素餐的interface啊
: 第二个太宽了,真的,这里面很多门道啊,很多思想,比如singlton最终完美thread
: safe版本里面用的double check都是从这个concurency里研究出来的。不好答啊,这个
: 题,md

l**s
发帖数: 421
13
c++的话可能需要double check

【在 t**********h 的大作中提到】
: 第一个是常规问题啊,顾名思义啊,尸位素餐的interface啊
: 第二个太宽了,真的,这里面很多门道啊,很多思想,比如singlton最终完美thread
: safe版本里面用的double check都是从这个concurency里研究出来的。不好答啊,这个
: 题,md

w**z
发帖数: 8232
14
double check had problem before Java fixed volatile

singleton = new Singleton()不行吗?这样直接避免同步了啊 望指教

【在 l**s 的大作中提到】
: singleton为什么要double check? 直接private static final Singleton singleton = new Singleton()不行吗?这样直接避免同步了啊 望指教
l**s
发帖数: 421
15
not got u, please be detailed

【在 w**z 的大作中提到】
: double check had problem before Java fixed volatile
:
: singleton = new Singleton()不行吗?这样直接避免同步了啊 望指教

w**z
发帖数: 8232
16
http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocki

【在 l**s 的大作中提到】
: not got u, please be detailed
y*******g
发帖数: 6599
17
这个不是lazy init

singleton = new Singleton()不行吗?这样直接避免同步了啊 望指教

【在 l**s 的大作中提到】
: singleton为什么要double check? 直接private static final Singleton singleton = new Singleton()不行吗?这样直接避免同步了啊 望指教
t**********h
发帖数: 2273
18
费内存啊,大姐
而且为毛你要把singleton static呢?这样也费啊,放内存上更好啊

singleton = new Singleton()不行吗?这样直接避免同步了啊 望指教

【在 l**s 的大作中提到】
: singleton为什么要double check? 直接private static final Singleton singleton = new Singleton()不行吗?这样直接避免同步了啊 望指教
l**s
发帖数: 421
19
老大你不设成static你下边的静态方法咋返回它??

【在 t**********h 的大作中提到】
: 费内存啊,大姐
: 而且为毛你要把singleton static呢?这样也费啊,放内存上更好啊
:
: singleton = new Singleton()不行吗?这样直接避免同步了啊 望指教

x*****p
发帖数: 1707
20
The singleton model with double check is as follows and is very popular in
the interview. However, there is a big bug in the following code.
public class MySingle {
private static MySingle instance;
private MySingle() {}
public static MySingle getInstance() {
if (instance==null) {
synchronized (MySingle.class) {
if (instance==null) {
instance = new MySingle();
}
}
}
return instance;
}
}
The code is lazy-loaded to save memory, is thread-safe with good performance
. However, there is still a bug inside.
相关主题
singleton哪种写法好?Palantir 2nd coding interview [pass, set for on-site]
C++ Singleton Template - 编译通不过面试常考哪些java的design pattern
Code for Singleton design patternBloomberg电面面经
进入JobHunting版参与讨论
a***u
发帖数: 36
21
类似第二题的也曾被问过。实际上感觉是相当重要的问题,不会这个题会让人感觉
senior 的含量究竟有多重。这一个问题需要一本书来回答,看上几遍都不为过。在多
核的时代,和利用多线 程的app, concurrent package 真是要很熟才好。
Singleton 较好的一种可以为类似以下的吧
public class MySingle {
private static class MySingleLoad {
private static MySingle SINGLE = new MySingle();
}
private MySingle() {}
public static MySIngle getInstance() {
return MySIngleLoad.SINGLE;
}
}
可是会这些,去面AMFLG第一轮都通不过吧
t**********h
发帖数: 2273
22
对哦,哥土了,你是对的。必须定static

【在 l**s 的大作中提到】
: 老大你不设成static你下边的静态方法咋返回它??
t**********h
发帖数: 2273
23
用inner class啊?牛逼啊

【在 a***u 的大作中提到】
: 类似第二题的也曾被问过。实际上感觉是相当重要的问题,不会这个题会让人感觉
: senior 的含量究竟有多重。这一个问题需要一本书来回答,看上几遍都不为过。在多
: 核的时代,和利用多线 程的app, concurrent package 真是要很熟才好。
: Singleton 较好的一种可以为类似以下的吧
: public class MySingle {
: private static class MySingleLoad {
: private static MySingle SINGLE = new MySingle();
: }
: private MySingle() {}
: public static MySIngle getInstance() {

z****e
发帖数: 54598
24
http://www.ibm.com/developerworks/java/library/j-dcl/index.html
把前面所有帖子给看了一遍,大概是搞懂了
从前面那个double-check的代码问题说起
那个代码理论上是ok的
但是实际上在singleton = new MySingleton();这一步里面
其实这里查看虚拟机机制之后发现汇编是分三步走
第一步是先划出一个内存区域
然后赋值给某个引用
最后再初始化这个引用,赋值神马的
那么由于synchronized了这个class,本意是在这三步完成之前
都不允许其它线程介入,但实际上是这三步过程中是有可能被其它线程抢占
而这三步中只要执行完第一步,那么singleton==null这个判断就是false
所以抢占的线程可能拿到的是一个未完全初始化的对象引用
那么如果这个时候使用,就会出问题
这就是那个big bug
所以
已知两个解决方案
1.不省内存了,直接在class被load的时候就初始化这个对象
就是前面那个“大姐”说的
2.利用inner class来节省对象
区别在于它利用了class不被load的时候就不会初始化这个内在对象的性质
以达到lazy load的目的(?)
3.是不是有更好的解决方案(?)
这个实在太有趣了,说了半天就是为了节省那一点点内存
是我就坚决使用那位“大姐”的方式,不省,除非有非常多的singleton
那如果有非常多的singleton,那用singleton干嘛? 除非有非常多singleton乘以非常
多的对象
那如果有非常多乘以非常多的对象,那省内存干嘛?除非省内存真的那么重要
那省内存既然那么重要,那用java干嘛?jvm不浪费内存么?真那么想省去用c好了
a***u
发帖数: 36
25
你列出的 1) 直接用static 是最常用的简单singleton方法;
2)使用static inner class 只多了三行代码而已,也不算什么。是为了lazy loading
省点memory, getInstance 被call时才load the inner class. 这个是我已知的最好
方法了。
要会灵活使用 concurrent package 的各种building block: synchronized原理,
semophor, CountDownLatch, CyclicBarrier, 各种Executors, 如何使用Executor
来增加scalability, Concurrent collections, 如何防止deadlock, ...这些有的
AMFLG Onsite时也有问的
看看咱国内人的水平吧: 以下是道我认为的经典题
淘宝面试题:如何充分利用多核CPU,计算很大的List中所有整数的和 http://flysnow.iteye.com/blog/711162

【在 z****e 的大作中提到】
: http://www.ibm.com/developerworks/java/library/j-dcl/index.html
: 把前面所有帖子给看了一遍,大概是搞懂了
: 从前面那个double-check的代码问题说起
: 那个代码理论上是ok的
: 但是实际上在singleton = new MySingleton();这一步里面
: 其实这里查看虚拟机机制之后发现汇编是分三步走
: 第一步是先划出一个内存区域
: 然后赋值给某个引用
: 最后再初始化这个引用,赋值神马的
: 那么由于synchronized了这个class,本意是在这三步完成之前

z****e
发帖数: 54598
26
因为两个check用的是同一个判断,都是singleton==null
而synchronized关键字是夹在两个判断中间
所以导致其它线程执行外面那个check的时候不需要synchornized
所以导致其它线程有可能在拿到一个未完成初始化的对象引用
从理论上说,那个double checked的代码其实也是错的
所以这个尝试其实是错误的,理论上就是有瑕疵的

loading
Executor

【在 a***u 的大作中提到】
: 你列出的 1) 直接用static 是最常用的简单singleton方法;
: 2)使用static inner class 只多了三行代码而已,也不算什么。是为了lazy loading
: 省点memory, getInstance 被call时才load the inner class. 这个是我已知的最好
: 方法了。
: 要会灵活使用 concurrent package 的各种building block: synchronized原理,
: semophor, CountDownLatch, CyclicBarrier, 各种Executors, 如何使用Executor
: 来增加scalability, Concurrent collections, 如何防止deadlock, ...这些有的
: AMFLG Onsite时也有问的
: 看看咱国内人的水平吧: 以下是道我认为的经典题
: 淘宝面试题:如何充分利用多核CPU,计算很大的List中所有整数的和 http://flysnow.iteye.com/blog/711162

z****e
发帖数: 54598
27
不过这个既然用inner class就可以搞定了,跟1.5有什么关系?

loading
Executor

【在 a***u 的大作中提到】
: 你列出的 1) 直接用static 是最常用的简单singleton方法;
: 2)使用static inner class 只多了三行代码而已,也不算什么。是为了lazy loading
: 省点memory, getInstance 被call时才load the inner class. 这个是我已知的最好
: 方法了。
: 要会灵活使用 concurrent package 的各种building block: synchronized原理,
: semophor, CountDownLatch, CyclicBarrier, 各种Executors, 如何使用Executor
: 来增加scalability, Concurrent collections, 如何防止deadlock, ...这些有的
: AMFLG Onsite时也有问的
: 看看咱国内人的水平吧: 以下是道我认为的经典题
: 淘宝面试题:如何充分利用多核CPU,计算很大的List中所有整数的和 http://flysnow.iteye.com/blog/711162

a***u
发帖数: 36
28
跟1.5没关系。以上哪位说起double check singleton in 1.5。
singleton 应该你列的1) 2)已经是最简最优的。其它的不是有问题就是error prone的

使用 lazy load 的inner class 的场合是 外面的class 's constructor 要用很多
memory 或很heavy, 同时外层class有其它 static method要被别人调用 (也就说外层
class的singleton heavy object 不一定会被用到,而这个class却必须要load以让其
它static method/field被别人调用,这样singleton 就没必要一开始就与class load
时生成了)

【在 z****e 的大作中提到】
: 不过这个既然用inner class就可以搞定了,跟1.5有什么关系?
:
: loading
: Executor

x*****p
发帖数: 1707
29
Yes, this is a better way. Before Java 1.5 with the concurrent package, this
way is the best for singleton. Now lots of interviewers do not know this
way any more.

【在 a***u 的大作中提到】
: 类似第二题的也曾被问过。实际上感觉是相当重要的问题,不会这个题会让人感觉
: senior 的含量究竟有多重。这一个问题需要一本书来回答,看上几遍都不为过。在多
: 核的时代,和利用多线 程的app, concurrent package 真是要很熟才好。
: Singleton 较好的一种可以为类似以下的吧
: public class MySingle {
: private static class MySingleLoad {
: private static MySingle SINGLE = new MySingle();
: }
: private MySingle() {}
: public static MySIngle getInstance() {

J**B
发帖数: 204
30
"只对一个数据做syncrhonized,而不限制其它的数据同时被访问
如果你有要求说在某一个线程访问时候,禁止其它数据被访问"
什么意思,具体解释一下,我面一家公司,我完全没有经验的,就想找个entry level也被问到类
似的问题。

【在 z****e 的大作中提到】
: google了一下,也不是太难
: 1.没有要求实现方法的interface统一叫做maker interface,本意是用这种方式告诉执
: 行的系统以关联一些原数据,比如一般情况下,大多数类是不会serializable,也就是
: 在不同虚拟机之间传递,会导致问题,所以要想让这个类在不同虚拟机之类传输正确,
: 就需要你去implements serializable这个接口,但是这个接口只是一个声明,不强制
: 要求你做任何事,系统看到这个interface之后,就会执行相关的操作,类似的还有
: cloneable等等
: 2.java.util.concurrent
: 就是对于很多并发控制的优化
: 比如hashtable和hashmap

相关主题
L家电面题目gg面试题
准备总结一下design pattern了被鄙视了, c++基础知识
Google电面被拒,郁闷中刚才有个讨论singleton的帖子,找不到了
进入JobHunting版参与讨论
z****e
发帖数: 54598
31
这两个都是core java的问题
跟j2ee没啥太大关系,但是也能说完全没有关系,j2se也是整体的一部分
map接口下面由这三个类实现
hashtable
concurrenthashmap
hashmap
第一个是synchronized,也就是说,当一个线程访问这个对象的时候
这个对象整体会被locked,不允许其它线程对其做任何操作,无论是读写还是神马的
第三个是完全不设防,任何线程在任何时间都可以做任何操作
但是这样在并发的时候有可能导致异常抛出
一个读同时另外一个写就会造成异常抛出
第三个太危险,第一个很安全,但是很浪费,因为一个大的map
你修改其中一个没有必要把其它所有的value全部给lock住不让别人访问
为了效率的提升,所以写出了这样一个类出来
简单说就是在hashmap的效率和hashtable的安全之间做了一个折中
尽最大可能提升了并发时候的效率并保证了安全
基本上所有concurrent包里面的实现类都是这个目的搞出来的
类似的还有copyonwritearraylist, copyonwritearrayset etc.
基本上这个包出来之后,什么hashtable, vector, stack之类的就可以淘汰掉了

level也被问到类

【在 J**B 的大作中提到】
: "只对一个数据做syncrhonized,而不限制其它的数据同时被访问
: 如果你有要求说在某一个线程访问时候,禁止其它数据被访问"
: 什么意思,具体解释一下,我面一家公司,我完全没有经验的,就想找个entry level也被问到类
: 似的问题。

z****e
发帖数: 54598
32
http://stackoverflow.com/questions/70689/efficient-way-to-imple
class Foo {
private static volatile Bar bar = null;
public static Bar getBar() {
if (bar == null) {
synchronized(Foo.class) {
if (bar == null)
bar = new Bar();
}
}
return bar;
}
}
1.5之后加一个volatile关键字,也能解决问题
但是牺牲了效率,因为volatile关键字本身就降低了效率
所以double check的完美其实并不完美,本身也降低了效率
既然降低了效率,那还不如直接消费掉那点内存算了
最bitchy的是enum的解决方式
简单说是把class写成enum
public enum Foo {
INSTANCE;
}
带方法等东东的实例
public enum Elvis {
INSTANCE;
private final String[] favoriteSongs =
{ "Hound Dog", "Heartbreak Hotel" };
public void printFavorites() {
System.out.println(Arrays.toString(favoriteSongs));
}
}
改动一个关键字,解决所有问题,连double check,实例化static对象神马都省了
但是枚举一个单子总让我感觉怪怪的
看老外的评论
多数人也认为不搞lazy load就可以了
也就是大多数时候前面那位“大姐”的做法是最优的
因为实在没有必要,甚至有人认为singleton本身都非必要

load

【在 a***u 的大作中提到】
: 跟1.5没关系。以上哪位说起double check singleton in 1.5。
: singleton 应该你列的1) 2)已经是最简最优的。其它的不是有问题就是error prone的
: 。
: 使用 lazy load 的inner class 的场合是 外面的class 's constructor 要用很多
: memory 或很heavy, 同时外层class有其它 static method要被别人调用 (也就说外层
: class的singleton heavy object 不一定会被用到,而这个class却必须要load以让其
: 它static method/field被别人调用,这样singleton 就没必要一开始就与class load
: 时生成了)

z****e
发帖数: 54598
33
老外评出的singleton
最优是
enum //改动两个单词,解决所有问题,包括serializable,这个在后面三种方式中都
需要额外处理
次优的是
inner class //仅仅为了lazy load,很多人觉得毫无必要

static final = new //这个是最常用的,inner class那个介入了虚拟机加载类的机制
最糟糕的是
double check+volatile //代码又长又tricky,要写一篇长文分析汇编代码来解释为什
么用double check,还需要留意volatile关键字,毫无必要,而且最后效率还被
volatile拖下来了,弄巧成拙
singleton模式就是一堆keywords的乐章
w****u
发帖数: 3147
34
受益匪浅啊
g*****g
发帖数: 34805
35
Marker interface is interface that you don't have to implement.
Like Serializable, Clonable.
The entire currency package is new on 1.5. Common used classes would be the
like of ConcurrentMap, CountDownlatch.
I think these two questions ain't too picky if you are looking for senior
positions.

【在 e***a 的大作中提到】
: 1. What is Java marker interface?
: 2. What new features have been added into the concurrency control
: by Java 1.5, as compared to Java 1.4?
: Can you answer these 2 questions promptly via the phone?
: I am applying for a J2EE position, but got these 2 questions
: from a phone interview by an Indian guy.

d****o
发帖数: 1055
36
电话面试有google这个强大的武器。

【在 e***a 的大作中提到】
: 1. What is Java marker interface?
: 2. What new features have been added into the concurrency control
: by Java 1.5, as compared to Java 1.4?
: Can you answer these 2 questions promptly via the phone?
: I am applying for a J2EE position, but got these 2 questions
: from a phone interview by an Indian guy.

v**n
发帖数: 219
37
that is cheating

【在 d****o 的大作中提到】
: 电话面试有google这个强大的武器。
1 (共1页)
进入JobHunting版参与讨论
相关主题
面试常考哪些java的design pattern关于singleton 的面试题
Bloomberg电面面经singleton pattern problem
L家电面题目请问一道special singleton class的题
准备总结一下design pattern了问一个thread safe singleton的问题
Google电面被拒,郁闷中hashmap跟hash table有啥区别?
gg面试题C++ Singleton的实现
被鄙视了, c++基础知识问个c++的问题
刚才有个讨论singleton的帖子,找不到了singleton哪种写法好?
相关话题的讨论汇总
话题: java话题: singleton话题: mysingle话题: lock话题: static