由买买提看人间百态

topics

全部话题 - 话题: threaded
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
c*****h
发帖数: 166
1
来自主题: JobHunting版 - multi-threading guru们
两个thread用一个对象吗?
b****n
发帖数: 84
2
来自主题: JobHunting版 - multi-threading guru们
c++的话用boost::thread::join()
n*********e
发帖数: 86
3
来自主题: JobHunting版 - multi-thread vs. multi-task
thread vs. process(or task can mean entirely different program)
m********l
发帖数: 4394
4
来自主题: JobHunting版 - 一道关于SMP and threading 题目
i is not thread safe?
这有意义吗?
counter都是0
x***i
发帖数: 23
5
来自主题: JobHunting版 - thread-safe 的 queue
no difficult. you can use atomic varibles and operations that is new
features ( #include ) from the new standard of C++11. it is lock-
free programming for multi-threads.
k******a
发帖数: 2436
6
t1.join() will block the calling thread until t1 exits
h*****3
发帖数: 1391
7
来自主题: JobHunting版 - Thread 和 concurrency怎么准备?
我朋友有一上来,就上机操作,全是thread的东西。好像是amd还是啥公司的
t*****e
发帖数: 53
8
来自主题: JobHunting版 - thread safe hash table
Implements a thread safe version of hash table. it should support
concurrent reads but protects on write.
Please paste your code.
j*****y
发帖数: 1071
9
来自主题: JobHunting版 - two functons and two threads
function A(), B()
Thread #1, #2
#1 call A()
#2 call B()
如何保证 A() 在 B() 前面被 call 阿?
l*********u
发帖数: 19053
10
来自主题: JobHunting版 - two functons and two threads
用semaphore
哪位给说说,俺thread用的不多,理解的对不对:
semaphore像个on/off flag,mutex lock/unlock是锁门/开门。
l*********u
发帖数: 19053
11
来自主题: JobHunting版 - two functons and two threads
哪位给说说,俺thread用的不多,理解的对不对:
semaphore像个on/off flag,mutex lock/unlock是锁门/开门。
s****e
发帖数: 75
12
来自主题: JobHunting版 - 问一个thread safe singleton的问题
看careercup上实现thread-safe singleton:
class Singleton{
private:
static Lock lock;
...
};
Lock Singleton::lock;
T * Singleton::Instance(){
if(object == 0){
lock.Acquirelock();
if(object == 0) {
object = new T;
}
lock.ReleaseLock();
}
return object;
}
请问可不可以把Instance函数写成这样的?不管三七二十一先锁起来再来判断
T * Singleton::Instance(){
lock.AcquireLock();
if(inst == 0) {
inst = new T;
}
lock.ReleaseLock();
return inst;
}
多谢大家指点。
G****A
发帖数: 4160
13
想申一个position,要求有一点multi-threading的背景知识,不是核心要求。
online link或者在线书都行,谢谢。
w**n
发帖数: 122
14
来自主题: JobHunting版 - Code a non blocking thread safe queue
glassdoor上LinkedIn的题
大牛能指点下吗?
我goog到这个,但是没太看懂
http://stackoverflow.com/questions/1645326/non-blocking-thread-
w**n
发帖数: 122
15
来自主题: JobHunting版 - Code a non blocking thread safe queue
你这个跟我goog到的那个很象。
但是我没看太懂
这个CAS是做什么的呢?
if (NULL == compare_and_swap(&tail->next, NULL, node))
如果tail->next是NULL(就说明没有别的thread来改过),然后就把tail->next置成node
? 是这意思吗?
s********r
发帖数: 403
16
来自主题: JobHunting版 - Code a non blocking thread safe queue
基本上是这个意思,
CAS 返回本内存地址的 old value, 如果是 NULL,证明当前thread 操作得手
这个是个 atomic, 没有条件判断的先后

node
p*****3
发帖数: 488
17
来自主题: JobHunting版 - Code a non blocking thread safe queue
queue->settail(node);
Race condition here?? When other thread is reading tail??
s********u
发帖数: 1109
s*w
发帖数: 729
19
来自主题: JobHunting版 - 请问C++ threading w/ lock free algorithms
我前一阵子刚使劲看过 C++11 里面的 multithreading
对 thread, mutex, lock_guard, condition_variable 比较熟悉, C++11 没
semaphore, 最高深的使用 promise/future,  async 来做,还不大会
n****e
发帖数: 678
20
来自主题: JobHunting版 - thread-safe blockingqueue
在网上和版上搜了半天,implement一个thread-safe blockingqueue. 大家看看有没有
问题:
import java.utils.LinkedList;
public class BlockingQueue {
private int capactiy;
private LinkedList elements;

public BlockingQueue(int capacity) {
if (capacity <=0 ) {
throw new exception();
}

this.capacity = capacity;
this.elements = new LinkedList ();
}

public synchronized void put(T t) {
while(elements.size() == capacity) {
w... 阅读全帖
m**p
发帖数: 189
21
来自主题: JobHunting版 - thread-safe blockingqueue
这个怎么样?
#include
#include
#include
#include
template
class Queue
{
public:
T pop()
{
std::unique_lock mlock(mutex_);
while (queue_.empty())
{
cond_.wait(mlock);
}
auto item = queue_.front();
queue_.pop();
return item;
}
void pop(T& item)
{
std::unique_lock mlock(mutex_);
while (queue_.empty())
{
cond_.wait(mlock);
}
item = queue_.front();
que... 阅读全帖
w*******e
发帖数: 395
22
来自主题: JobHunting版 - n thread rendezvous怎么做用semaphore
不懂题目什么意思
这俩thread难道不已经是用semaphore实现的了吗?
a**x
发帖数: 14
23
来自主题: JobHunting版 - c++ thread 求助 (转载)
C++11好像有thread了
w********s
发帖数: 1570
24
c++写一个thread pool的实现
m*********0
发帖数: 46
25
来自主题: JobHunting版 - 请教三个多线程(multi-threading)题目
2. Call stack上存的是当前正被调度运行的线程调用栈
3. heap是process wide。stack是thread wide, 函数调用结束后会frame会被unwind

give
c**z
发帖数: 669
26
来自主题: JobHunting版 - 请教一个thread的问题
被问了两次,一次apple,一次expedia
一个线程是如何和stack 和 heap联系在一起的
如果你创造一个 thread,这是在stack上还是heap上,
w**z
发帖数: 8232
27
来自主题: JobHunting版 - 请教一个thread的问题
每个thread 都有一个stack, 一个process 只有一个heap。 local variable
reference 在stack 里。
w********s
发帖数: 1570
28
来自主题: JobHunting版 - 请教一个thread的问题
一个thread有自己的stack,通常是2m
share一个heap,通常情况下。
g********o
发帖数: 132
29
请问
thread和process区别,
parallel和concurrent 区别
谢谢
z******g
发帖数: 271
30
A process is associated with an execution context which includes a virtual
memory space, opened file handles, signals and etc. Whereas forked threads
share those resources.
Concurrency is when things look like they happen at the same time.
Parallelism is when things do happen at the same time. You can think of
parallelism a subset of concurrency.
c**z
发帖数: 669
31
In a multithreaded environment, what are two types of methods to protect
memory from being written over
by two threads at the same time?
mutex, 还有什么?
D**C
发帖数: 6754
32
我觉得你对许多multi threading的基本知识还不太明白,推荐你看 Java Concurrency
in Practice

versus
y*****e
发帖数: 712
33
好怕这种thread safe的题,不知有人愿意分享一下代码吗?在网上找了几个代码,因
为半懂不懂的,也分不出个好坏高低来,还是觉得板上牛人多。
http://codereview.stackexchange.com/questions/7002/java-blockin
c********t
发帖数: 5706
34
我总结了下面这些。
其实面试中multi-threading coding的题很少,一般是问一下基本概念。我简历上写了
multithreading, 但是很多次onsite,只被问过一次ReadWriteLock。
基本概念就是以下这些
synchronized, lock (ReentrantLock, ReadWriteLock), semaphore, condition,
atomic, mutex,wait, notify, notifyAll, condition.wait, condition.signal
这些概念最好都看看例子。
其次coding 题,准备好这三道题:ReadWriteLock, BlockingQueue, H2O
R********r
发帖数: 3415
35
来自主题: Living版 - does "1/2 In. thread = 1/2 IPS" ??
no, not necessarily
IPS size means OD, but "1/2 In. thread" may be ID, and, for the tubing using
in home water/sewer system, it is using ID, which confused me when I went
to HD to pick up the hose for my sink.
s***y
发帖数: 2607
a******e
发帖数: 36306
37
来自主题: Living版 - 1200 thread count sheet only $58
thread太多了不好,经常睡不醒
p****u
发帖数: 2596
38
800 Thread 是不是足够好拉?还看到有1200的。也不知道有多大区别。amazon上
看到的
p****u
发帖数: 2596
39
要怎么伺候?threads高更容易坏和脏吗?

发帖数: 1
40
来自主题: Living版 - 什么threaded rod上有约5mm的孔?
想给一根3/8''的螺杆一端钻一个约5mm的孔,用来改装我的望远镜adjustment bar. 完
全没工具(电钻),也买不到这样的螺杆。
考虑过用coupling nut拼接某个小的带孔和螺旋的配件在一端,搜了半天也没头绪(不
清楚各种配件的英文名)。通过google image 发现threaded eyebolt是一个可行的选
项,但貌似洞太大了。
请问大家有什么建议么?什么配件可以提供一个约直径5mm的孔?我的螺杆是3/8''的,
tpi 16
如果有在maryland或DC的朋友愿意出手帮钻一个就万分感谢了!
Edit: 为了实现这里的adjustment bar:
http://www.astronomyforum.net/celestron-nexstar-telescope-forum/112765-4se-polar-alignment-modified-latitude-adjustment-bar.html
m*******p
发帖数: 1978
41
来自主题: Living版 - 什么threaded rod上有约5mm的孔?
search for "thread clevis yoke"
l*h
发帖数: 4124
42
来自主题: Medicine版 - please lock the following thread
please lock this thread
http://www.mitbbs.com/article_t/Medicine/31189467.html
probably the patient passed away a few months ago.
y*****a
发帖数: 580
43
1. bt/aor:
http://www.fatwallet.com/t/52/632935/
2. apr for saving/chcking:
http://www.fatwallet.com/t/52/437553/
almost answer all the questions, except cc application bonus. (there is a
thread, but not good.)
From my experience:
(1) BOA mma is good, if you have chking as well with boa, and careful enough.
(2) citi is best in bt, because perks in application, bt, credit protector
(3) boa is the next in bt, because of perks of application, and bt
(4) amex is the best to be the denominator
(5) ch
m**********n
发帖数: 27535
44
【 以下文字转载自 Military 讨论区 】
发信人: ddyourself (nah), 信区: Military
标 题: Re: 家里有男孩的应该好好读一下reddit上的这个thread
发信站: BBS 未名空间站 (Thu Jan 19 23:08:19 2017, 美东)
看到不看到有个蛋用。难道老中们自己不知道被歧视?ABC小孩都是自己抱团取暖难道
老中父母不知道?
n*******2
发帖数: 603
45
来自主题: shopping版 - bed sheets 多少thread count好? (转载)
【 以下文字转载自 Living 讨论区 】
发信人: nikki0202 (nikki), 信区: Living
标 题: bed sheets 多少thread count好?
发信站: BBS 未名空间站 (Thu Jun 24 20:37:34 2010, 美东)
越高越好么?
1000以上?
s*****r
发帖数: 1745
46
Wavelets shall do suck type of thread.
s*****r
发帖数: 1745
47
what I meants is you shall do a specific journal thread so we froggies could
learn better from you.
y*********c
发帖数: 1014
48
http://boards.msn.com/Travelboards/thread.aspx?threadid=398068
Just saw the news on MSN. Apparently, it is not favorable to China. This is
the forum. Please are debating in there. We should all let the world know Xi
Zang is the part of China.
w***e
发帖数: 452
49
马甲逃不过偶的火眼金睛◎◎
你要去纽约么?
shapes threading salon
1030 39th street (6th avenue)
2nd floor
212-703-9311
是一群印度大妈开的,用线刮眉毛的那种,如果眉毛浓的话弄出来很pp。
j**4
发帖数: 10425
50
the thread is sooo long. u get a bunch of women, and they can talk nonstop
and repetitive
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)