Facebook Interview Question
Software Engineer / Developersstatic void
PVSCSIEnableReqCallThreshold(PVSCSIAdapter *adapter) //IN/OUT
{
PVSCSIShared *s = adapter->shared;
s->cptState.reqCallThresholdCapable = TRUE;
if (PVSCSIReqCallThresholdCapable(s)) {
PhysMem_Token rsToken;
if (adapter->shared->busmaster &&
PhysMem_ValidateAndGet(PPN_2_PA(adapter->ringsStatePPN), PAGE_SIZE,
PHYSMEM_WRITE, adapter->shared->pciHandle,
&rsToken)) {
PVSCSIRingsState *ringState = PhysMem_GetPtr(&rsToken);
ringState->reqCallThreshold = s->cptState.reqCallThresholdConfig;
LOG(0, (LGPFX" Enabled reqCallThreshold with %d depth\n",
ringState->reqCallThreshold));
PhysMem_Release(&rsToken);
s->cptState.cmdStatus = 1;
if (!s->syncMode) {
s->syncMode = TRUE;
PVSCSIChangeSyncMode(adapter, TRUE, FALSE);
}
} else {
s->cptState.reqCallThresholdCapable = FALSE;
}
}
Log(LGPFX" scsi%u: init reqCallThresholdCapable %u\n",
adapter->hdr.id, s->cptState.reqCallThresholdCapable);
}
Statically typed languages associate type with variables. Hence, type checking is done during compile time. ( C, C++, Java....)
- Anonymous December 02, 2009Dynamically typed languages associate type with values. Thus, type checking would be done during run time. ( Python, Perl, Objective-C....)