G
Guest
Hello All,
I am working on introducing threading to my single threaded application to
take advantage of these multi-core processors.
I qurery for user data from file share and Active Directory with using two
methods
UserData data = GetFromFileShare(userName);
if(data == null)
{
data = GetFromAD(userName);
}
I want to do these two opertions in parallel to reduce the time for overall
operation incase data is in AD (which is 85% most of the time but we have tp
consider File share since file share data gets priority)
1. Execute two threads for these two operations.
2. Wait for File share method to finish. If it returns result, do not wait
for AD thread to finish and return.
3. If FileShare returns null, wait for AD to finish and return AD result.
4. If AD also returns null, throw UserDataNotFoundException
Can you experts provide me a code snippet to do this in .Net 2.0?
Thanks a million for this,
I am working on introducing threading to my single threaded application to
take advantage of these multi-core processors.
I qurery for user data from file share and Active Directory with using two
methods
UserData data = GetFromFileShare(userName);
if(data == null)
{
data = GetFromAD(userName);
}
I want to do these two opertions in parallel to reduce the time for overall
operation incase data is in AD (which is 85% most of the time but we have tp
consider File share since file share data gets priority)
1. Execute two threads for these two operations.
2. Wait for File share method to finish. If it returns result, do not wait
for AD thread to finish and return.
3. If FileShare returns null, wait for AD to finish and return AD result.
4. If AD also returns null, throw UserDataNotFoundException
Can you experts provide me a code snippet to do this in .Net 2.0?
Thanks a million for this,